This is the mail archive of the 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 for %E formatting for C

On Sun, 2 Oct 2004, Gabriel Dos Reis wrote:

> that point C++ front-end would cease to pass plain IDENTIFIER_NODE
> around -- I expect it will wrap them in something that is an
> expression, otherwise the whole front-end will break :-). 
> And I also expect that, at that point, th C front-end wouold improve too.

It has already improved in some places where identifiers could be confused 
with other trees (for example, declarators now wrap the identifier in a 
separate structure rather than having the IDENTIFIER_NODE itself represent 
an identifier as a declarator).  There is indeed plenty more to do.

> One could argue that the cases where the C front-end would need to
> pass IDENTIFIER_NODE to the pretty-printer should be inexistant, and
> it does then it contains a bug.  If an IDENTIFIER_NODE is the name of
> a _DECL, then pass that decl, not the identifier.

There are many cases where %qs is presently used with IDENTIFIER_POINTER, 
where there is an identifier that does not correspond to a DECL.  For 
example, all the instances of

      warning ("%qs attribute ignored", IDENTIFIER_POINTER (name));

or the error

      error ("label %qs referenced outside of any function",
             IDENTIFIER_POINTER (name));

- so there is a clear use for %qI for such cases, while others should 
become %qD, if a DECL can be identified (even if presently the name rather 
than the DECL is being passed to the relevant function).  At the same time 
there is a clear use for %E for genuine expressions, and probably many C 
front end diagnostics could be improved by its use.

Joseph S. Myers      - status of C90 for GCC 4.0 (personal mail) (Bugzilla assignments and CCs)

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