This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Request for a compiler feature
- To: "Ross Smith" <ross dot s at ihug dot co dot nz>
- Subject: Re: Request for a compiler feature
- From: Andi Kleen <ak at muc dot de>
- Date: 22 Jun 1998 02:55:53 +0200
- Cc: <egcs at cygnus dot com>
- References: <00a901bd9d4f$9c38fe80$a8a01dcb@animal.ihug.co.nz>
"Ross Smith" <ross.s@ihug.co.nz> writes:
> Suggestion: Emit the typedefs separately from the main error message.
> Something like this:
>
> foo.cpp:123: Error: MyMapType and MyOtherMapType are incompatible
> foo.cpp:123: MyMapType is typedef for std::pair<Key, const Value>
> foo.cpp:123: MyOtherMapType is typedef for std::pair<Key, Value>
>
> That gives you the clearer error messages in the common cases where the
> types involved are complicated template instantiations (e.g.
> std::string) but the details aren't relevant, but if you need to you can
> still check that the types are what you thought they were.
That would still confuse the error message listing a lot, because STL
typedefs are often over several lines. I think this case is special enough
that it could be turned on by a separate switch, with the default to off.
To make it clear gcc could tell the user about it on the first encounter
of a typedef in a message.
foo.cpp:123: Error: MyMapType and MyOtherMapType are incompatible
foo.cpp:123: Typedef not expanded, use -Wexpand-typedef to change.
A -W prefix is not really 100% right, but seems to be the best option
here.
-A.