Which gcc switch disables “left-hand operand of comma has no effect” warning?
Question
It's a part of larger code base, which forces -Werror on gcc. This warning is generated in a third party code that shouldn't be changed (and I actually know how to fix it), but I can disable specific warnings. This time man gcc failed me, so please, let some gcc master enlighten me. TIA.
Solution
It is the -Wno-unused-value option, see the documentation
OTHER TIPS
If you use -fdiagnostics-show-option, GCC will tell you how to disable a warning (if possible).
Have you tried using a diagnostic pragma directive? These are available in gcc 4.2.1+, I believe.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow