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 to add ATTRIBUTE_PRINTF to errors.h

"Kaveh R. Ghazi" <> writes:

| The comment in errors.h notwithstanding, all of the variadic functions
| in errors.c should be using ATTRIBUTE_PRINTF since they all simply
| pass along to vfprintf.

That is not true.  Many non-printf format specifiers are used, see
usage in the C++ front-end.  

The trend is that we should also use them in the C front-end.

| The errors.h file is mostly used by generator programs, but there are

The errors.h file should just go away in favor of diagnostic.h. 

| a few cases like rtl.c in which it is used with both generator
| programs and the gcc backend which relies on the extended functions in
| diagnostic.c.  I would say that these dual use files >must not< use
| any of the extensions in the diagnostic framework because if it did
| then when it is linked with a generator program it won't work!

That is not the right way to proceed.  A better way is to strip
diagnostic.[hc] of the tree thingies and make it available for use by
other parts.  There is no point in duplicating functionalities ad infinitum.

| So this patch enforces that dictum.  Bootstrapped on
| sparc-sun-solaris2.7, no new warnings.
| Ok for mainline?

No for the reasons stated above.

-- Gaby

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