named warnings & individual warning control

Per Bothner per@bothner.com
Tue Jun 22 22:23:00 GMT 2004


DJ Delorie wrote:

> A catalog also allows for grouping to be defined in both directions -
> a group can specify its messages, and a message can define the groups
> it's in.  This allows either policy to be implemented without a code
> change.

I suggest a design where a 'message id' can refer to either a single
message or a group of messages, and where it is easy to change this.

I.e. suppose I have a 'bad-format' message ID that is triggered
by mis-formed format string and controlled by -Wbad-format.  A later
release might add more specific messages: 'too-few-args-to-format',
'unknown-format-code', 'bad-format-argument' etc.  In that case we
redefine 'bad-format' to be a group that (to the extent possible)
(1) includes all messages controlled by that ID in the old release;
(2) does not include any messages that were in the old release but
not covered by that ID;
(3) and may or may not cover some new messages that were not
in the old release.

Similarly, if we decide to change the name of an ID, we can keep the
old ID as an alias - where an alias is just a group of one message.
-- 
	--Per Bothner
per@bothner.com   http://per.bothner.com/



More information about the Gcc mailing list