This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/32448] [3.3 / 3.4 / 4.1 / 4.2 / 4.3 Regression] abs / printf bug
- From: "kargl at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 23 Jun 2007 17:56:52 -0000
- Subject: [Bug c/32448] [3.3 / 3.4 / 4.1 / 4.2 / 4.3 Regression] abs / printf bug
- References: <bug-32448-13830@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #14 from kargl at gcc dot gnu dot org 2007-06-23 17:56 -------
(In reply to comment #13)
> (In reply to comment #11)
> > (1) Try -Wformat
>
> "-Wall" includes "-Wformat" according to gcc.info. See comment 7 for the
> command line I used:
> /* /usr/test/bin/gcc -Wall -Wconversion -o math_test_7 math_test_7.c */
mobile:kargl[204] cc -o z -Wformat m.c -lm
m.c: In function 'main':
m.c:21: warning: format '%d' expects type 'int', but argument 2 has type
'double'
m.c:21: warning: format '%d' expects type 'int', but argument 3 has type
'double'
m.c:21: warning: format '%d' expects type 'int', but argument 4 has type
'double'
m.c:21: warning: format '%d' expects type 'int', but argument 5 has type
'double'
m.c:21: warning: format '%d' expects type 'int', but argument 6 has type
'double'
m.c:22: warning: format '%d' expects type 'int', but argument 2 has type
'double'
m.c:22: warning: format '%d' expects type 'int', but argument 3 has type
'double'
m.c:22: warning: format '%d' expects type 'int', but argument 4 has type
'double'
m.c:22: warning: format '%d' expects type 'int', but argument 5 has type
'double'
m.c:22: warning: format '%d' expects type 'int', but argument 6 has type
'double'
mobile:kargl[205] cc -o z -Wall m.c -lm
m.c: In function 'main':
m.c:9: warning: implicit declaration of function 'abs'
m.c:21: warning: format '%d' expects type 'int', but argument 2 has type
'double'
m.c:21: warning: format '%d' expects type 'int', but argument 3 has type
'double'
m.c:21: warning: format '%d' expects type 'int', but argument 4 has type
'double'
m.c:21: warning: format '%d' expects type 'int', but argument 5 has type
'double'
m.c:21: warning: format '%d' expects type 'int', but argument 6 has type
'double'
m.c:22: warning: format '%d' expects type 'int', but argument 2 has type
'double'
m.c:22: warning: format '%d' expects type 'int', but argument 3 has type
'double'
m.c:22: warning: format '%d' expects type 'int', but argument 4 has type
'double'
m.c:22: warning: format '%d' expects type 'int', but argument 5 has type
'double'
m.c:22: warning: format '%d' expects type 'int', but argument 6 has type
'double'
m.c is your code in comment #7
>
>
> > (3) There is an expectation someone writing C might actually
> > adhere to the Standard
>
> From time to time that does not always occur. See here:
>http://gcc.gnu.org/bugzilla/buglist.cgi?emailreporter1=1&emailtype1=substring&email1=kargl@gcc.gnu.org
I'm not sure what you're trying to demonstate. Bug reports associated with me
are related to Fortran not C.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32448