This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
any way to disable a single *instance* of a GCC warning?
- From: "Rainer Gerhards" <rgerhards at gmail dot com>
- To: gcc-help at gcc dot gnu dot org
- Date: Mon, 23 Jun 2008 10:26:30 +0200
- Subject: any way to disable a single *instance* of a GCC warning?
Hi,
I have quite some of these during my compile:
imfile.c: In function 'runInput':
imfile.c:298: warning: suggest braces around empty body in 'do' statement
They are a result of the pthreads library (pthread_cleanup_pop(0)). So
I can not simply "fix" this issue. There are similar issues with other
libraries.
I know that I can turn off these warning via options, but with that I
turn them off for all of my source. But I would like to retain that
warning for my code, so that it helps my find places where I screwed
up.
I wonder if there is any way to disable a warning for the next line. I
have seen that some compilers do this via a #pragma, but I have not
found any such pragma in GCC.
So: is there a way to suppress a single instance of a known warning?
Any feedback is deeply appreciated.
Thanks,
Rainer