Another issue with diagnostic format-checker
Zack Weinberg
zack@codesourcery.com
Sat Jul 19 17:12:00 GMT 2003
Gabriel Dos Reis <gdr@integrable-solutions.net> writes:
> "Zack Weinberg" <zack@codesourcery.com> writes:
>
> | Gabriel Dos Reis <gdr@integrable-solutions.net> writes:
> |
> | > 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.
> |
> | If we cannot have it in header files, I would prefer an explicit
> | #define at the top of every .c file.
>
> Defining it at the top of every .c file does not make the core problem
> go away -- in fact it is no different from what Kaveh did.
Okay, hold on a second. I have not been following this discussion
closely, but there seems to be a basic confusion on your part. The
format-checking takes place when the compiler is compiled, not when it
runs. Therefore the set of format specifiers valid in each .c file
must be determined statically when that .c file is compiled. The only
way we could make it vary depending on the front end, for a file that
is put into more than one front end, is to compile that file more than
once.
Do you understand and agree with that statement as a description of
the way things are? Not necessarily the way you want it to work,
just the way it is right now?
zw
More information about the Gcc
mailing list