Re: [Wireshark-dev] error: logical && with non-zero constant will always evaluate as true

2013-01-04 Thread Jeff Morriss
Guy Harris wrote: On Jan 3, 2013, at 1:40 PM, Jeff Morriss wrote: Jeff Morriss wrote: My (Fedora 10) gcc 4.3.2 was also generating this warning; it would seem that a fair spread of gcc versions seem to have the problem. I added a configure check to stop using -Wlogical-op if the compiler is

Re: [Wireshark-dev] error: logical && with non-zero constant will always evaluate as true

2013-01-03 Thread Guy Harris
On Jan 3, 2013, at 1:40 PM, Jeff Morriss wrote: > Jeff Morriss wrote: >> My (Fedora 10) gcc 4.3.2 was also generating this warning; it would seem >> that a fair spread of gcc versions seem to have the problem. >> I added a configure check to stop using -Wlogical-op if the compiler is >> genera

Re: [Wireshark-dev] error: logical && with non-zero constant will always evaluate as true

2013-01-03 Thread Jeff Morriss
Jeff Morriss wrote: My (Fedora 10) gcc 4.3.2 was also generating this warning; it would seem that a fair spread of gcc versions seem to have the problem. I added a configure check to stop using -Wlogical-op if the compiler is generating this warning in r46916. Interestingly the Ubuntu buildb

Re: [Wireshark-dev] error: logical && with non-zero constant will always evaluate as true

2013-01-03 Thread Jakub Zawadzki
On Sat, Dec 29, 2012 at 10:37:42AM -0500, Evan Huus wrote: > In the meantime, I'm not really sure what the best workaround is... What about using memchr() ? This might be little stupid, but if we avoid warning this way (in cost of some readability)... Cheers, Kuba. __

Re: [Wireshark-dev] error: logical && with non-zero constant will always evaluate as true

2013-01-03 Thread Jeff Morriss
My (Fedora 10) gcc 4.3.2 was also generating this warning; it would seem that a fair spread of gcc versions seem to have the problem. I added a configure check to stop using -Wlogical-op if the compiler is generating this warning in r46916. Evan Huus wrote: While 'separators' is not immediat

Re: [Wireshark-dev] error: logical && with non-zero constant will always evaluate as true

2012-12-29 Thread Evan Huus
While 'separators' is not immediately constant either, wtap_file_read_till_separator (the function containing the strchr) is called in only one place, and that call passes in a string constant to the 'separators' parameter. GCC is smart enough to figure that out, so __builtin_constant_p [1] return

Re: [Wireshark-dev] error: logical && with non-zero constant will always evaluate as true

2012-12-29 Thread Martin Kaiser
Thus wrote Martin Kaiser (li...@kaiser.cx): > which seems to evaluate on my system (debian squeeze) more specifically martin@skogar:~$ gcc -v Using built-in specs. Target: x86_64-linux-gnu Configured with: ../src/configure -v --with-pkgversion='Debian 4.4.5-8' --with-bugurl=file:///usr/share/doc

[Wireshark-dev] error: logical && with non-zero constant will always evaluate as true

2012-12-29 Thread Martin Kaiser
Dear all, I get this warning (error) when I compile svn head peektagged.c: In function ???wtap_file_read_till_separator???: peektagged.c:150: error: logical ???&&??? with non-zero constant will always evaluate as true make[2]: *** [libwiretap_la-peektagged.lo] Error 1 The offending line is