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


"Zack Weinberg" <zack@codesourcery.com> writes:

| Gabriel Dos Reis <gdr@integrable-solutions.net> writes:
| 
| > "Zack Weinberg" <zack@codesourcery.com> writes:
| >
| > | Gabriel Dos Reis <gdr@integrable-solutions.net> writes:
| > | 
| > | > | > It removes the inclusion order dependency and lets each front end say
| > | > | > what its "set" looks like.
| > | > | 
| > | > | So does putting #defines in the relevant source files.
| > | >
| > | > No, it does not. See previous discussion with Kaveh.
| > | 
| > | Your assertion is a contradiction in terms, because -DFOO=bar is
| >
| > No it is not, see below.
| >
| > | precisely equivalent to "#define FOO bar" appearing on the first line
| > | of the source file. 
| >
| > but it removes the inclusion order dependency.
| 
| But it doesn't!  There is still an ordering dependency between the
| #define and the #include.  All you've done is apply magic to make it
| harder to get the ordering wrong,

That is the important property is worrying me: Make it impossible to
get the ordering wrong, therefore removing the inclusion order
dependency. 

| at the cost of comprehensibility

You must certainly be kidding.  What is incomprehensible in
  
  -DGCC_DIAG_STYLE=__gcc_xxx__

| (since the #define is hiding in a magic location) and maintainability
| (you have to add crap to the Makefile).

On the contrary, it removes the maintainability nightmarre you're
proposing. 

| > | The only reason to prefer -DFOO=bar is if the
| > | value of 'bar' is determined by the Makefile, but you have said that
| > | it is not.
| >
| > Where?
| 
| When you said that you didn't intend to compile files twice.

I hope you realize what invention you're creating.

| Perhaps I was unclear:

What, however, is clear is the invention you've created. 

| if the literal string '-DFOO=bar' appears in
| the makefile, that's an undesirable use of -D, because it could have
| been a #define in the source code instead. 

This does not make sense in the context of this discussion.

| If the text in the
| makefile is '-DFOO=$(FOO)', and there's a variable definition FOO=bar
| elsewhere in the makefile (and that variable actually *varies* on some
| condition, otherwise constant propagation reduces this to the
| preceding case), then it is an appropriate use of -D.
| 
| No, I don't like -DIN_GCC either.

So it is more about *your* personal preference over technical material. 
I hope this isn't an attitude called to be developed as the GCC
project goes.

-- Gaby


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