public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/15444] New: Bad warning message in printf format checking
@ 2004-05-15 9:11 james-gcc-bugzilla-501qll3d at and dot org
2004-05-15 9:47 ` [Bug c/15444] " james-gcc-bugzilla-501qll3d at and dot org
` (5 more replies)
0 siblings, 6 replies; 7+ messages in thread
From: james-gcc-bugzilla-501qll3d at and dot org @ 2004-05-15 9:11 UTC (permalink / raw)
To: gcc-bugs
Although gcc can check i18n parameter specifiers in printf format strings, the
warning given if you mix them is the confusing 'warning: unknown conversion type
character `$' in format'. Admitedly SuSv3 does say...
The format can contain either numbered argument conversion specifications (that
is, "%n$" and "*m$"), or unnumbered argument conversion specifications (that is,
% and * ), but not both.
...however glibc does work in this mode, as do a number of other implementations
of printf.
--
Summary: Bad warning message in printf format checking
Product: gcc
Version: 3.3.2
Status: UNCONFIRMED
Severity: enhancement
Priority: P2
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: james-gcc-bugzilla-501qll3d at and dot org
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15444
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c/15444] Bad warning message in printf format checking
2004-05-15 9:11 [Bug c/15444] New: Bad warning message in printf format checking james-gcc-bugzilla-501qll3d at and dot org
@ 2004-05-15 9:47 ` james-gcc-bugzilla-501qll3d at and dot org
2004-05-15 10:28 ` jsm at polyomino dot org dot uk
` (4 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: james-gcc-bugzilla-501qll3d at and dot org @ 2004-05-15 9:47 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From james-gcc-bugzilla-501qll3d at and dot org 2004-05-14 18:08 -------
Created an attachment (id=6292)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=6292&action=view)
test case compile with "gcc -Wall -W -o gcc-bug gcc-bug.c"
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15444
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c/15444] Bad warning message in printf format checking
2004-05-15 9:11 [Bug c/15444] New: Bad warning message in printf format checking james-gcc-bugzilla-501qll3d at and dot org
2004-05-15 9:47 ` [Bug c/15444] " james-gcc-bugzilla-501qll3d at and dot org
@ 2004-05-15 10:28 ` jsm at polyomino dot org dot uk
2004-05-15 12:22 ` james-gcc-bugzilla-501qll3d at and dot org
` (3 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: jsm at polyomino dot org dot uk @ 2004-05-15 10:28 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From jsm at polyomino dot org dot uk 2004-05-14 18:18 -------
Subject: Re: New: Bad warning message in printf format checking
On Fri, 14 May 2004, james-gcc-bugzilla-501qll3d at and dot org wrote:
> The format can contain either numbered argument conversion specifications (that
> is, "%n$" and "*m$"), or unnumbered argument conversion specifications (that is,
> % and * ), but not both.
>
> ...however glibc does work in this mode, as do a number of other implementations
> of printf.
This must be some strange meaning of "work" - far from documenting any
meaning for which argument an unnumbered specifier takes if there are also
numbered ones (next from the start, or from the previous numbered one?),
the glibc manual expressly repeats that it is undefined:
# If any of the formats has a specification for the parameter position all
# of them in the format string shall have one. Otherwise the behavior is
# undefined.
The diagnostics could however be improved to check for $ argument numbers
when it is known they must not appear and give a more specific diagnostic.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15444
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c/15444] Bad warning message in printf format checking
2004-05-15 9:11 [Bug c/15444] New: Bad warning message in printf format checking james-gcc-bugzilla-501qll3d at and dot org
2004-05-15 9:47 ` [Bug c/15444] " james-gcc-bugzilla-501qll3d at and dot org
2004-05-15 10:28 ` jsm at polyomino dot org dot uk
@ 2004-05-15 12:22 ` james-gcc-bugzilla-501qll3d at and dot org
2004-05-15 16:13 ` pinskia at gcc dot gnu dot org
` (2 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: james-gcc-bugzilla-501qll3d at and dot org @ 2004-05-15 12:22 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From james-gcc-bugzilla-501qll3d at and dot org 2004-05-14 18:38 -------
Yes, the main point was that the message should be different.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15444
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c/15444] Bad warning message in printf format checking
2004-05-15 9:11 [Bug c/15444] New: Bad warning message in printf format checking james-gcc-bugzilla-501qll3d at and dot org
` (2 preceding siblings ...)
2004-05-15 12:22 ` james-gcc-bugzilla-501qll3d at and dot org
@ 2004-05-15 16:13 ` pinskia at gcc dot gnu dot org
2004-05-15 18:19 ` cvs-commit at gcc dot gnu dot org
2004-05-15 18:20 ` pinskia at gcc dot gnu dot org
5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-05-15 16:13 UTC (permalink / raw)
To: gcc-bugs
--
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |diagnostic
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15444
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c/15444] Bad warning message in printf format checking
2004-05-15 9:11 [Bug c/15444] New: Bad warning message in printf format checking james-gcc-bugzilla-501qll3d at and dot org
` (3 preceding siblings ...)
2004-05-15 16:13 ` pinskia at gcc dot gnu dot org
@ 2004-05-15 18:19 ` cvs-commit at gcc dot gnu dot org
2004-05-15 18:20 ` pinskia at gcc dot gnu dot org
5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-05-15 18:19 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From cvs-commit at gcc dot gnu dot org 2004-05-15 00:44 -------
Subject: Bug 15444
CVSROOT: /cvs/gcc
Module name: gcc
Changes by: jsm28@gcc.gnu.org 2004-05-15 00:44:03
Modified files:
gcc : ChangeLog c-format.c
gcc/testsuite : ChangeLog
gcc/testsuite/gcc.dg/format: xopen-1.c
Added files:
gcc/testsuite/gcc.dg/format: xopen-3.c
Log message:
PR c/15444
* c-format.c (avoid_dollar_number): New function.
(check_format_info_main): Call avoid_dollar_number when operand
numbers might occur but has_operand_number == 0.
testsuite:
* gcc.dg/format/xopen-1.c: Adjust expected message.
* gcc.dg/format/xopen-3.c: New test.
Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.3659&r2=2.3660
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/c-format.c.diff?cvsroot=gcc&r1=1.54&r2=1.55
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.3748&r2=1.3749
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/format/xopen-3.c.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/format/xopen-1.c.diff?cvsroot=gcc&r1=1.3&r2=1.4
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15444
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c/15444] Bad warning message in printf format checking
2004-05-15 9:11 [Bug c/15444] New: Bad warning message in printf format checking james-gcc-bugzilla-501qll3d at and dot org
` (4 preceding siblings ...)
2004-05-15 18:19 ` cvs-commit at gcc dot gnu dot org
@ 2004-05-15 18:20 ` pinskia at gcc dot gnu dot org
5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-05-15 18:20 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-05-15 00:46 -------
Fixed for 3.5.0.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |FIXED
Target Milestone|--- |3.5.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15444
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2004-05-15 0:46 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-05-15 9:11 [Bug c/15444] New: Bad warning message in printf format checking james-gcc-bugzilla-501qll3d at and dot org
2004-05-15 9:47 ` [Bug c/15444] " james-gcc-bugzilla-501qll3d at and dot org
2004-05-15 10:28 ` jsm at polyomino dot org dot uk
2004-05-15 12:22 ` james-gcc-bugzilla-501qll3d at and dot org
2004-05-15 16:13 ` pinskia at gcc dot gnu dot org
2004-05-15 18:19 ` cvs-commit at gcc dot gnu dot org
2004-05-15 18:20 ` 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).