public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/1027] slightly misleading printf format warning
       [not found] <20001209174601.1027.cwitty@newtonlabs.com>
@ 2003-05-24 23:41 ` pinskia@physics.uc.edu
  2003-11-01 10:21 ` jsm28 at gcc dot gnu dot org
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 11+ messages in thread
From: pinskia@physics.uc.edu @ 2003-05-24 23:41 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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



------- Additional Comments From pinskia@physics.uc.edu  2003-05-24 23:26 -------
still happens on the mainline (20030524):

pr1027.c:7: warning: int format, double arg (arg 2)
pr1027.c:8: warning: char format, double arg (arg 2)
pr1027.c:9: warning: int format, pointer arg (arg 2)
pr1027.c:10: warning: format argument is not a pointer (arg 2)



------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug c/1027] slightly misleading printf format warning
       [not found] <20001209174601.1027.cwitty@newtonlabs.com>
  2003-05-24 23:41 ` [Bug c/1027] slightly misleading printf format warning pinskia@physics.uc.edu
@ 2003-11-01 10:21 ` jsm28 at gcc dot gnu dot org
  2004-01-19 19:27 ` pinskia at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 11+ messages in thread
From: jsm28 at gcc dot gnu dot org @ 2003-11-01 10:21 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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


jsm28 at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |debian-gcc at lists dot
                   |                            |debian dot org


------- Additional Comments From jsm28 at gcc dot gnu dot org  2003-11-01 10:21 -------
*** Bug 12867 has been marked as a duplicate of this bug. ***


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug c/1027] slightly misleading printf format warning
       [not found] <20001209174601.1027.cwitty@newtonlabs.com>
  2003-05-24 23:41 ` [Bug c/1027] slightly misleading printf format warning pinskia@physics.uc.edu
  2003-11-01 10:21 ` jsm28 at gcc dot gnu dot org
@ 2004-01-19 19:27 ` pinskia at gcc dot gnu dot org
  2004-05-27 16:24 ` pinskia at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-01-19 19:27 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |minor


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


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug c/1027] slightly misleading printf format warning
       [not found] <20001209174601.1027.cwitty@newtonlabs.com>
                   ` (2 preceding siblings ...)
  2004-01-19 19:27 ` pinskia at gcc dot gnu dot org
@ 2004-05-27 16:24 ` pinskia at gcc dot gnu dot org
  2004-06-01 14:37 ` bangerth at dealii dot org
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-05-27 16:24 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-05-26 23:04 -------
*** Bug 15657 has been marked as a duplicate of this bug. ***

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |paulmoore100 at hotmail dot
                   |                            |com


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


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug c/1027] slightly misleading printf format warning
       [not found] <20001209174601.1027.cwitty@newtonlabs.com>
                   ` (3 preceding siblings ...)
  2004-05-27 16:24 ` pinskia at gcc dot gnu dot org
@ 2004-06-01 14:37 ` bangerth at dealii dot org
  2004-06-01 15:04 ` gdr at integrable-solutions dot net
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 11+ messages in thread
From: bangerth at dealii dot org @ 2004-06-01 14:37 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From bangerth at dealii dot org  2004-06-01 14:37 -------
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." 
? 
 
W. 

-- 


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


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug c/1027] slightly misleading printf format warning
       [not found] <20001209174601.1027.cwitty@newtonlabs.com>
                   ` (4 preceding siblings ...)
  2004-06-01 14:37 ` bangerth at dealii dot org
@ 2004-06-01 15:04 ` gdr at integrable-solutions dot net
  2004-06-01 15:37 ` jsm at polyomino dot org dot uk
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 11+ messages in thread
From: gdr at integrable-solutions dot net @ 2004-06-01 15:04 UTC (permalink / raw)
  To: gcc-bugs


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

"bangerth at dealii dot org" <gcc-bugzilla@gcc.gnu.org> writes:

| I also find the message overly terse. The abbreviated form "arg" for 

Agreed.

-- Gaby


-- 


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


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug c/1027] slightly misleading printf format warning
       [not found] <20001209174601.1027.cwitty@newtonlabs.com>
                   ` (5 preceding siblings ...)
  2004-06-01 15:04 ` gdr at integrable-solutions dot net
@ 2004-06-01 15:37 ` jsm at polyomino dot org dot uk
  2004-06-01 15:52 ` bangerth at dealii dot org
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 11+ messages in thread
From: jsm at polyomino dot org dot uk @ 2004-06-01 15:37 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From jsm at polyomino dot org dot uk  2004-06-01 15:37 -------
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.



-- 


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


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug c/1027] slightly misleading printf format warning
       [not found] <20001209174601.1027.cwitty@newtonlabs.com>
                   ` (6 preceding siblings ...)
  2004-06-01 15:37 ` jsm at polyomino dot org dot uk
@ 2004-06-01 15:52 ` bangerth at dealii dot org
  2004-06-01 16:08 ` gdr at integrable-solutions dot net
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 11+ messages in thread
From: bangerth at dealii dot org @ 2004-06-01 15:52 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From bangerth at dealii dot org  2004-06-01 15:52 -------
Sounds pretty good to me :-) 
W. 

-- 


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


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug c/1027] slightly misleading printf format warning
       [not found] <20001209174601.1027.cwitty@newtonlabs.com>
                   ` (7 preceding siblings ...)
  2004-06-01 15:52 ` bangerth at dealii dot org
@ 2004-06-01 16:08 ` gdr at integrable-solutions dot net
  2004-07-01  8:52 ` cvs-commit at gcc dot gnu dot org
  2004-07-02  0:24 ` pinskia at gcc dot gnu dot org
  10 siblings, 0 replies; 11+ messages in thread
From: gdr at integrable-solutions dot net @ 2004-06-01 16:08 UTC (permalink / raw)
  To: gcc-bugs


------- 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


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug c/1027] slightly misleading printf format warning
       [not found] <20001209174601.1027.cwitty@newtonlabs.com>
                   ` (8 preceding siblings ...)
  2004-06-01 16:08 ` gdr at integrable-solutions dot net
@ 2004-07-01  8:52 ` cvs-commit at gcc dot gnu dot org
  2004-07-02  0:24 ` pinskia at gcc dot gnu dot org
  10 siblings, 0 replies; 11+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-07-01  8:52 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2004-07-01 08:52 -------
Subject: Bug 1027

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	jsm28@gcc.gnu.org	2004-07-01 08:52:33

Modified files:
	gcc            : ChangeLog c-format.c c-lang.c c-objc-common.c 
	                 c-pretty-print.c c-tree.h 
	gcc/objc       : objc-lang.c 
	gcc/testsuite  : ChangeLog 
	gcc/testsuite/gcc.dg: Wswitch-enum.c Wswitch.c 
	gcc/testsuite/gcc.dg/format: branch-1.c diag-1.c multattr-3.c 
	                             xopen-1.c 
Added files:
	gcc/testsuite/gcc.dg/format: diag-2.c 

Log message:
	PR c/1027
	* c-lang.c (c_initialize_diagnostics): Move from here ...
	* c-objc-common.c: ... to here.  Include "c-pretty-print.h".
	(c_tree_printer): Use pretty-printer to format %T.
	* c-pretty-print.c (pp_c_specifier_qualifier_list): Include space
	before '*' if not C++.
	(pp_c_direct_abstract_declarator): Don't try to print array upper
	bound for flexible array members.
	* c-tree.h: Include "diagnostic.h".
	(c_initialize_diagnostics): Declare.
	* objc/objc-lang.c (LANG_HOOKS_INITIALIZE_DIAGNOSTICS): Define.
	* c-format.c (format_type_warning): New function.  Improve
	diagnostics for incorrect format argument types.
	(check_format_types): Use it.  Add two parameters.  Use the
	TYPE_MAIN_VARIANT of wanted_type.
	(check_format_info_main): Pass new parameters to
	check_format_types.
	(struct format_wanted_type): Update comment.
	
	testsuite:
	* gcc.dg/Wswitch-enum.c, gcc.dg/Wswitch.c,
	gcc.dg/format/branch-1.c, gcc.dg/format/diag-1.c,
	gcc.dg/format/multattr-3.c, gcc.dg/format/xopen-1.c: Update
	expected warning text.
	* gcc.dg/format/diag-2.c: New test.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.4240&r2=2.4241
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/c-format.c.diff?cvsroot=gcc&r1=1.58&r2=1.59
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/c-lang.c.diff?cvsroot=gcc&r1=1.127&r2=1.128
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/c-objc-common.c.diff?cvsroot=gcc&r1=1.49&r2=1.50
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/c-pretty-print.c.diff?cvsroot=gcc&r1=1.50&r2=1.51
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/c-tree.h.diff?cvsroot=gcc&r1=1.157&r2=1.158
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/objc/objc-lang.c.diff?cvsroot=gcc&r1=1.45&r2=1.46
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.3930&r2=1.3931
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/Wswitch-enum.c.diff?cvsroot=gcc&r1=1.3&r2=1.4
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/Wswitch.c.diff?cvsroot=gcc&r1=1.4&r2=1.5
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/format/diag-2.c.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/format/branch-1.c.diff?cvsroot=gcc&r1=1.2&r2=1.3
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/format/diag-1.c.diff?cvsroot=gcc&r1=1.2&r2=1.3
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/format/multattr-3.c.diff?cvsroot=gcc&r1=1.1&r2=1.2
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/format/xopen-1.c.diff?cvsroot=gcc&r1=1.4&r2=1.5



-- 


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


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug c/1027] slightly misleading printf format warning
       [not found] <20001209174601.1027.cwitty@newtonlabs.com>
                   ` (9 preceding siblings ...)
  2004-07-01  8:52 ` cvs-commit at gcc dot gnu dot org
@ 2004-07-02  0:24 ` pinskia at gcc dot gnu dot org
  10 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-07-02  0:24 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-07-02 00:24 -------
Fixed.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|---                         |3.5.0


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


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2004-07-02  0:24 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20001209174601.1027.cwitty@newtonlabs.com>
2003-05-24 23:41 ` [Bug c/1027] slightly misleading printf format warning pinskia@physics.uc.edu
2003-11-01 10:21 ` jsm28 at gcc dot gnu dot org
2004-01-19 19:27 ` pinskia at gcc dot gnu dot org
2004-05-27 16:24 ` pinskia at gcc dot gnu dot org
2004-06-01 14:37 ` bangerth at dealii dot org
2004-06-01 15:04 ` gdr at integrable-solutions dot net
2004-06-01 15:37 ` jsm at polyomino dot org dot uk
2004-06-01 15:52 ` bangerth at dealii dot org
2004-06-01 16:08 ` gdr at integrable-solutions dot net
2004-07-01  8:52 ` cvs-commit at gcc dot gnu dot org
2004-07-02  0:24 ` pinskia at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).