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: Selective warnings


Geoff Keating <geoffk@cygnus.com> writes:

|> Philipp Thomas <pthomas@suse.de> writes:
|> 
|> > And that's the reason Uniforum came up with a different proposal, which Sun
|> > implemented and which the FSF folowed when implementing the gettext
|> > interface. For gettext, the passed message is the unique id.
|> ...
|> > Then the programmer could switch off a specific warning with #pragma.
|> > 
|> > What I have to do now is to think about a way to implement this, foremost
|> > how to implement a warning map. My first guess would be a bitmap where the
|> > warning option is the index. Such a map would then also make it possible to
|> > implement pushing/poping warning 'states'.
|> 
|> As an alternative, why not simply keep a table of strings or regular
|> expressions, and just check each warning against the table before
|> printing it?  pushing/popping the warning states could be done by just
|> keeping track of the earlier context of the table.
|> 
|> I would imagine something like 
|> 
|> "#pragma" "gcc" "nowarn" [ "line" expression ] [ string ]

This has one drawback: #pragma cannot be generated as part of macro
expansion.  But that will be a non-issue once gcc implements the C99
_Pragma operator.

Andreas.

-- 
Andreas Schwab                                  "And now for something
SuSE Labs                                        completely different."
Andreas.Schwab@suse.de
SuSE GmbH, Schanzäckerstr. 10, D-90443 Nürnberg

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