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: [PATCH] PR c++/33255 - Support -Wunused-local-typedefs warning


Jason Merrill <jason@redhat.com> writes:

> On 07/29/2011 08:36 AM, Dodji Seketeli wrote:
>> Looking into this a bit, it seems to me that I can access
>> cfun->language->base (of type c_language_function) from inside either
>> the C or C++ FE only, as the type of cfun->language -- which is of type
>> struct language_function -- is only defined either in c-lang.h or
>> cp-tree.h.  I cannot access it from c-common.c.
>
> I think you can use (struct c_language_function *)cfun->language.

I see.

Looking a bit further, it looks like the C FE uses cfun->language only
to store the context of the outer function when faced with a nested
function.  This is done by c_push_function_context, called by
c_parser_declaration_or_fndef.  Otherwise, cfun->language is not
allocated.  Is it appropriate that -Wunused-local-typedefs allocates it
as well?

-- 
		Dodji


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