This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: RFC: Named warnings
- From: Theodore Papadopoulo <Theodore dot Papadopoulo at sophia dot inria dot fr>
- To: Stan Shebs <shebs at apple dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Fri, 24 Jan 2003 11:27:09 +0100
- Subject: Re: RFC: Named warnings
shebs@apple.com said:
> It may still be that some warnings are composites, as with -Wunused,
> which controls several other warnings that each have an individual
> control, but this is up to the implementation.
Instead of thinking composite, may I propose a slight generalization
of the concept, in that every warning has to belong to a composite.
The idea is to create a hierarchy of warnings (and errors by the way)
a la object oriented language, ie each warning (with a granularity to be
defined more precisely as already mentionned) has:
1) a name [number or string, both have advantages and it might
be easy to propose both but just at user interface level with a
variant of the flag showing the warning names (after all a number
is nothing else than a index into an array of strings)].
2) a parent which describes basically the class of warnings
to which it belongs.
The root warning is obviously something like "all-warnings" and the
only one that is its own parent or has no parent at all (at choice).
This way there will be a real taxonomy of warnings within the
compiler. The immediate descendants of "all-warnings" could be eg
target-independant-warnings and target-dependant-warnings.
I believe that simple inheritance schemes should be sufficient, but I
may be wrong (actually the composite view is slightly more powerful
than the inheritance view in this respect since I suppose that a
warning can belong to multiple composites) in which case the scheme
would be slightly more complicated as there would be multiple parents.
The main question, can we categorize all the current warnings into
such a hierarchy ???
--------------------------------------------------------------------
Theodore Papadopoulo
Email: Theodore.Papadopoulo@sophia.inria.fr Tel: (33) 04 92 38 76 01
--------------------------------------------------------------------