This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Warnings in the C++ Front-End and GCC in General


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."


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]