This is the mail archive of the
mailing list for the GCC project.
Re: Patch to add ATTRIBUTE_PRINTF to errors.h
- From: Gabriel Dos Reis <gdr at integrable-solutions dot net>
- To: "Kaveh R. Ghazi" <ghazi at caip dot rutgers dot edu>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: 21 May 2003 02:43:33 +0200
- Subject: Re: Patch to add ATTRIBUTE_PRINTF to errors.h
- Organization: Integrable Solutions
- References: <200305202357.TAA26301@caip.rutgers.edu>
"Kaveh R. Ghazi" <firstname.lastname@example.org> 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.