This is the mail archive of the gcc@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: Another issue with diagnostic format-checker


"Kaveh R. Ghazi" <ghazi@caip.rutgers.edu> writes:

|  > From: Gabriel Dos Reis <gdr@integrable-solutions.net>
|  > 
|  > Hi,
|  > 
|  >   I came across another issue: The file c-pragama.c is a C and
|  > Objective-C specific file.  Yet, the diagnostic format-specifier
|  > checher doesn't want to let me use %D there -- %D is explicilty listed
|  > as a format specifier for the C and Objective-C front ends.
|  > 
|  > How am I supposed to convince it to let '%D' pass through?
|  > 
|  > Thanks,
|  > -- Gaby
| 
| You must define GCC_DIAG_STYLE to __gcc_cdiag__ before including
| toplev.h.

Now, this is rendering the whole machinery inclusion order dependent.
A recipe for disaster.

|  You can either do it explicitly or by including c-tree.h
| (as most other C frontend file do.)

Instead of insisting on hardwiring GCC_DIAG_STYLE (thus opening the
door for all kinds of nightmarre) in files, I'll reiterate what I
suggested earlier: 
 
  GCC_DIAG_STYLE should be set by each individual front-end, directly.
 
We already do this for other flags.  
An obvious way to do that is for each front-end Makefile to use
something like   

    -DGCC_DIAG_STYLE=__gcc_xxx__

when compiling files used in that front end.  That way, we don't depend
on inclusion order, or file inclusion otherwise unnecessary.

There might be other more elaborated ways to accomplish the same thing, but
relying on inclusion other is NOT viable.   

If you agree on the above scheme, I'll try to produce a patch.

-- Gaby


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