Warning wrapping (was RE: Suppressing specific compiler warnings)

Ruth Ivimey-Cook Ruth.Ivimey-Cook@ivimey.org
Thu May 27 08:07:00 GMT 2004


Matt wrote:

> I agree that names are good.  I'd just like to distinguish 
> between the name of a warning and the text that gets printed 
> out.  If I write struct A {
>    int x;
>    int y;
>    A() : y(2), x(3) { }
> };
> then (on at least one compiler version; in general the 
> details vary from release to release) I will get:
> 
> foo.cc: In constructor `A::A()':
> foo.cc:3: warning: `A::y' will be initialized after
> foo.cc:2: warning:   `int A::x'

One of the things I dislike about current gcc versions is multiline
warnings. Is there any way to make the compiler produce:

> foo.cc: In constructor `A::A()':
> foo.cc:3: warning: `A::y' will be initialized after `int A::x'

Instead?
Ruth




More information about the Gcc mailing list