[trunk][patch] Don't print warnings in mangle_decl

Rafael Espindola espindola@google.com
Thu Apr 16 01:10:00 GMT 2009


> I suspect that's not the right place to put the check.  That function
> shouldn't be called for variables whose RTL is never needed -- and even
> it is called now it will not be at some point in the future when we get
> smarter about RTL generation.  I suspect that something more like
> cp_finish_decl is going to be the right place, but I'm not entirely sure.

I selected it by looking at a back trace in gdb of where in trunk we
compute the assembly name (and therefore print the message). If I
remember correctly, it was the last c++ function before getting to
mangle_decl. This is to makes the behavior with the patch as close to
as possible as the behavior without.

I will take another look to see if cp_finish_decl is a good place.

> The bottom line is that you need to make sure that references to even
> undefined symbols (whether variables or functions) trigger the warnings.

I tested it for functions. In fact, a test is include in the patch. I
will test external variables.

>  Maybe the best way to handle this is actually just to queue up all the
> DECLs that caused warnings and emit them at the very end of compilation.
> Then you can be sure of getting everything, but get them at a
> predictable time.

Predictable, but not the time the c++ FE expects. For it to print
warnings that include the "instantiated form" bits we must produce the
warnings while the FE is looking at the instantiation (if I understand
the FE code correctly).

> --
> Mark Mitchell
> CodeSourcery
> mark@codesourcery.com
> (650) 331-3385 x713
>


Cheers,
-- 
Rafael Avila de Espindola

Google | Gordon House | Barrow Street | Dublin 4 | Ireland
Registered in Dublin, Ireland | Registration Number: 368047



More information about the Gcc-patches mailing list