any way to disable a single *instance* of a GCC warning?

Rainer Gerhards
Mon Jun 23 08:27:00 GMT 2008


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

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

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.


More information about the Gcc-help mailing list