Wiznet / ioLibrary_Driver

ioLibrary_Driver can be used for the application design of WIZnet TCP/IP chips as W5500, W5300, W5200, W5100 W5100S.
MIT License
603 stars 331 forks source link

Ethernet/socket.c:520:36: error: suggest parentheses around comparison in operand of '&' [-Werror=parentheses] #38

Closed vanvught closed 6 years ago

vanvught commented 6 years ago

This file cannot be build with -Werror

Ethernet/socket.c: In function 'sendto': Ethernet/socket.c:520:36: error: suggest parentheses around comparison in operand of '&' [-Werror=parentheses] if((taddr == 0) && (getSn_MR(sn)&Sn_MR_MACRAW != Sn_MR_MACRAW)) return SOCKERR_IPINVALID; ^ Ethernet/socket.c:521:36: error: suggest parentheses around comparison in operand of '&' [-Werror=parentheses] if((port == 0) && (getSn_MR(sn)&Sn_MR_MACRAW != Sn_MR_MACRAW)) return SOCKERR_PORTZERO; ^

khj098765 commented 6 years ago

What kind of IDE you used?

vanvught commented 6 years ago

arm-none-eabi-gcc -mfpu=vfp -march=armv6zk -mtune=arm1176jzf-s -mcpu=arm1176jzf-s -DRPI1 -DBARE_METAL -DNDEBUG -I./include -I./ioLibrary_Driver/Ethernet -I./../lib-bcm2835/include -I./../lib-debug/include -I./../include -Wall -Werror -O2 -nostartfiles -nostdinc -nostdlib -ffreestanding -mhard-float -mfloat-abi=hard -DWIZCHIP=5100 -c ioLibrary_Driver/Ethernet/socket.c -o build/W5100/ioLibrary_Driver/Ethernet/socket.o ioLibrary_Driver/Ethernet/socket.c: In function ‘_sendto’: ioLibrary_Driver/Ethernet/socket.c:521:36: error: suggest parentheses around comparison in operand of ‘&’ [-Werror=parentheses] if((taddr == 0) && (getSn_MR(sn)&Sn_MR_MACRAW != Sn_MR_MACRAW)) return SOCKERR_IPINVALID; ^ ioLibrary_Driver/Ethernet/socket.c:522:36: error: suggest parentheses around comparison in operand of ‘&’ [-Werror=parentheses] if((port == 0) && (getSn_MR(sn)&Sn_MR_MACRAW != Sn_MR_MACRAW)) return SOCKERR_PORTZERO; ^ cc1: all warnings being treated as errors Makefile:108: recipe for target 'build/W5100/ioLibrary_Driver/Ethernet/socket.o' failed make: *** [build/W5100/ioLibrary_Driver/Ethernet/socket.o] Error 1

pi@nuc-i5:~/workspace/lib-wiznet$ arm-none-eabi-gcc --version arm-none-eabi-gcc (GCC) 7.3.0 Copyright (C) 2017 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

vanvught commented 6 years ago

@khj098765 Please will consider to re-open this issue and fix the bug? Thanks.

vanvught commented 6 years ago

@khj098765 Please will consider to re-open this issue and fix the bug? Thanks.