Im building som software using boost 1.48 on osx 10.8 with gcc version 4.2.1 and i have started getting -Wparentheses-equality
warnings for some of the boost source.
equality comparison with extraneous parentheses
[-Werror,-Wparentheses-equality]
else if((state->type == syntax_element_long_set_rep))
I would change the code but i dont want to tinker with the library, how would i silence the warning and make the compiler continue?
From the GCC manual:
Most of these have both positive and negative forms; the negative form of
-ffoo
would be-fno-foo
.
Try -Wno-parentheses-equality
.
As an alternative to simply disabling the warning you can also specify certain paths to count as 'system' paths. Warnings are suppressed for system headers, so you can declare that a particular library's headers are 'system' headers and that you don't care about warnings in them.
clang's argument for this is --system-header-prefix=<prefix>
So for example you might say "--system-header-prefix=boost/"
http://clang.llvm.org/docs/UsersManual.html#controlling-diagnostics-in-system-headers
And judging by the error message you are actually using clang and not gcc.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With