This is the mail archive of the
mailing list for the GCC project.
- To: Mark Mitchell <mark at codesourcery dot com>
- Subject: Selective warnings
- From: Philipp Thomas <pthomas at suse dot de>
- Date: Thu, 22 Jun 2000 04:15:46 +0200
- Cc: gcc at gcc dot gnu dot org
I started this as a private message but now think it should be public in the
hope that it'll restart the discussion.
I've read your proposal from September 98 and the replies. While I don't
agree with most of the replies you got, I do have to agree that enumerating
the warnings is a bad idea as it will cause a maintenance nightmare.
This would lead to same trouble programmers had with the X/Open catgets
interface for localized messages. Catgets requires as one of its arguments a
unique message id. Let me quote from gettext.info:
This has to be a numeric value for all messages in a single set.
Perhaps you could imagine the problems keeping such list while changing
the source code. Add a new message here, remove one there. Of course
there have been developed a lot of tools helping to organize this chaos
but one as the other fails in one aspect or the other.
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.
And *this* is the way we should go if we want to implement selective
warnings. That means that the warning option itself is the id on which to
act. This would of course require that each warning does get its own warning
option, but that is by far easier then enumerating them.
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'.
Philipp Thomas <email@example.com>
Development, SuSE GmbH, Schanzaecker Str. 10, D-90443 Nuremberg, Germany
#define NINODE 50 /* number of in core inodes */
#define NPROC 30 /* max number of processes */
-- Version 7 UNIX for PDP 11, /usr/include/sys/param.h