Your changes to diagnostic machinery

Gabriel Dos Reis gdr@integrable-solutions.net
Sat Jul 19 15:12:00 GMT 2003


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

[...]

| Perhaps you mean extensible format checking?  That's where the valid
| formats are defined in the code being compiled.

Yes.

|  That's still a
| compile-time check, but the format itself is flexible.  If you update
| the source code, you can at the same time update the set of valid
| specifiers.  That's not available in gcc today.
| 
| If that's what you meant, note that it has no impact on our discussion
| about c-common.c where we still need to *pick* one format not multiple
| ones as you seem to suggest.

%D, for example, is one format specifier used by all C front ends to mean
the same thing. 

I was quite surprised to see that changing unsafe construct like

   pedwarn_with_decl (decl, "blah blah %s");

to something robust like

   pedwarn ("%Hblah blah '%D'", &DECL_SOURCE_LOCATION (decl), decl);

triggered a warning syaing that %D is not valid, which is untrue.

-- Gaby



More information about the Gcc mailing list