[Bug c/1027] slightly misleading printf format warning

gdr at integrable-solutions dot net gcc-bugzilla@gcc.gnu.org
Tue Jun 1 16:08:00 GMT 2004


------- Additional Comments From gdr at integrable-solutions dot net  2004-06-01 16:07 -------
Subject: Re:  slightly misleading printf format warning

"jsm at polyomino dot org dot uk" <gcc-bugzilla@gcc.gnu.org> writes:

| Subject: Re:  slightly misleading printf format warning
| 
| On Tue, 1 Jun 2004, bangerth at dealii dot org wrote:
| 
| > I also find the message overly terse. The abbreviated form "arg" for 
| > argument sounds too much like an unquoted reference to a variable. 
| > Why can't we speak English as in most other messages, for example 
| >   "The format contains a char*, but argument 2 is a float." 
| > ? 
| 
| How about something like
| 
| warning: format '%s' expects a char *, but argument 2 has type float *
| 
| (i.e., giving the particular format with bad argument type)?
| 
| The %T format isn't yet hooked up to the pretty-printer code for printing
| types, once it is then improving these warnings will be straighforward.

Absolutely.  Apart from not using the GNU coding style, the
pretty-printer in gcc/c-pretty-printer.[hc] is ready for used in the
C front-end.  If you plan to use it before I complete the new C++
pretty-printer, please don't lose the style :-)

[Note: The current pretty-printer will print "char*" (C++ style)
       as opposed to "char *" (GNU style). ]

-- Gaby
 


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=1027



More information about the Gcc-bugs mailing list