Warnings in the C++ Front-End and GCC in General
Tim Hollebeek
tim@wagner.princeton.edu
Tue Sep 8 09:26:00 GMT 1998
Manfred Hollstein writes ...
>
> #ifndef _common_include_file_h
> # define _common_include_file_h
>
> ...
> #pragma gcc_disable_warn (62)
> ...
> #pragma gcc_restore_warn (62)
> ...
> #endif
>
> will then leave the warning flag's status untouched after this file has
> been #include'd.
It doesn't nest.
enter x.h
#pragma disable 62
enter y.h
#pragma disable 62
#pragma restore 62
leave y.h
warning 62! [etc]
#pragma restore 62
leave x.h
also, don't use numbers for the warnings. Completely unreadable and
unmaintainable. In an ideal world, I'd like:
#pragma warnings push
#pragma warnings no-implicit-int no-unused missing-declarations
[...]
#pragma warnings pop
---------------------------------------------------------------------------
Tim Hollebeek | "Everything above is a true
email: tim@wfn-shop.princeton.edu | statement, for sufficiently
URL: http://wfn-shop.princeton.edu/~tim | false values of true."
More information about the Gcc
mailing list