This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Rafael Espindola wrote:
>> I don't know of an easy example, but it should be easy to modify the
>> mangling routines to always generate a warning.  Then, you can see if
>> you get a warning about variables.
> 
> Sure. I changed finish_mangling_internal to do *abi_warning = 1 and
> found that we would not print warnings for global variables. I changed
> make_rtl_for_nonlocal_decl to fix that. The updated patch is attached.

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.

The bottom line is that you need to make sure that references to even
undefined symbols (whether variables or functions) trigger the warnings.
 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.

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]