This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
c/6547: misleading printf '$' format
- From: peio at blutch dot dyndns dot org
- To: gcc-gnats at gcc dot gnu dot org
- Cc: prpetit at canal-plus dot com
- Date: 3 May 2002 13:02:15 -0000
- Subject: c/6547: misleading printf '$' format
- Reply-to: peio at blutch dot dyndns dot org
>Number: 6547
>Category: c
>Synopsis: misleading printf '$' format
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Fri May 03 06:06:01 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator: Pierre PETIT
>Release: gcc version 3.0.4 (and 2.95.4)
>Organization:
>Environment:
Debian GNU/Linux (testing) x86
Linux kernel 2.4.18 - libc v2.2.5
>Description:
Formats with '$' character get a warning on gcc-3.0,
when compiling with -Wall (or at least -Wformat):
"warning: unknown conversion type character '$' in format"
With both v2.95 and 3.0, there is a warning on "%.*1$s":
"warning: unknown conversion type character '1' in format"
>How-To-Repeat:
#include <stdio.h>
int main (int argc, char *argv[]) {
printf("%.*s == %2$.*1$s\n", argc, *argv);
return 0;
}
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: