Quantcast
Channel: Active questions tagged gcc - Stack Overflow
Viewing all articles
Browse latest Browse all 22028

How do you disable the unused variable warnings coming out of gcc in 3rd party code I do not wish to edit?

$
0
0

I'd like to know what switch you pass to the gcc compiler to turn off unused variable warnings? I'm getting errors out of boost on windows and I do not want to touch the boost code:

C:\boost_1_52_0/boost/system/error_code.hpp: At global scope:C:\boost_1_52_0/boost/system/error_code.hpp:214:36: error: 'boost::system::posix_category' defined but not used [-Werror=unused-variable]C:\boost_1_52_0/boost/system/error_code.hpp:215:36: error: 'boost::system::errno_ecat' defined but not used [-Werror=unused-variable]C:\boost_1_52_0/boost/system/error_code.hpp:216:36: error: 'boost::system::native_ecat' defined but not used [-Werror=unused-variable]

I tried using both -Wunused-value and -Wno-unused-value but neither suppressed the messages above.

What is the right command, here is my compile line:

g++  -g -fno-inline -Wall -Werror -Wextra -Wfloat-equal -Wshadow-Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Wno-conversion -Wdisabled-optimization -Wredundant-decls -Wunused-value -Wno-deprecated -IC:\\boost_1_52_0 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -c -o op.o op.cpp

Perhaps the -Wall overrides my goal?


Viewing all articles
Browse latest Browse all 22028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>