How to disable warnings when compiling C code?

I am working on a 32-bit Fedora 14 system. I am compiling source code using gcc .

Does anyone know how to disable warnings when compiling c-code?

+6
source share
3 answers

try adding the -w option when compiling

http://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html

+13
source

Each body says to use the -Wall switch with gcc, but you want to disable it. It is not recommended to use a debugger to find it.

Linus Torvalds:

β€œBut this is certainly the only right way. The fact that everyone else does it differently means only that they are wrong.”

+5
source

It’s best to find the problem. This will prevent you from looking in the future for errors that would not occur if you corrected the actual one.

But if you are sure that there is no error or you are sure that the problem is caught by your code, put this somewhere in the file (where 177 is the number of your warning):

 #pragma diag_suppress 177 // supress #177-D function was declared but never referenced 
+1
source

Source: https://habr.com/ru/post/893932/


All Articles