https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90205
--- Comment #11 from Jonny Grant ---
That last comment was using
gcc (Ubuntu 12.2.0-3ubuntu1) 12.2.0
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90205
--- Comment #10 from Jonny Grant ---
printf("sizeof time_t %ld\n", sizeof(time_t));
Another example, but suggesting the same %ld from a sizeof
broken.c:34:29: error: format ‘%ld’ expects argument of type ‘long int’, but
argument 2 has type ‘lon
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90205
--- Comment #9 from Eric Gallager ---
(In reply to Tavian Barnes from comment #8)
> Maybe "argument 2 has type 'double' (promoted from 'float')"?
Yes, that seems better to me, at least...
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90205
Tavian Barnes changed:
What|Removed |Added
CC||tavianator at gmail dot com
--- Comment
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90205
Eric Gallager changed:
What|Removed |Added
CC||egallager at gcc dot gnu.org
--- Comment
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90205
--- Comment #6 from Jonny Grant ---
Wondering if it is also worth the message making clear the type was promoted?
eg:
:5:14: warning: format '%d' expects argument of type 'int', but
argument 2 has type 'float' automatically promoted to 'double'
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90205
Jakub Jelinek changed:
What|Removed |Added
Status|ASSIGNED|NEW
CC|
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90205
--- Comment #4 from Jonathan Wakely ---
(In reply to Jonny Grant from comment #2)
> The 'argument' is float, within the printf it arrives as a 'parameter' of
> type double after the promotion before the call.
Yes, it seems more correct to say "b
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90205
--- Comment #3 from Jonny Grant ---
A clang++ example, doing it as I expected, showing the type before automatic
promotion. I did with char, as I couldn't find a -Wformat-signedness for the
original example code in clang++
#include
int main()
{
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90205
--- Comment #2 from Jonny Grant ---
(In reply to Andreas Schwab from comment #1)
> %f is correct for double.
Yes, the float was promoted to double via the ellipsis ... as I understand it
(default type promotion - I am sure you know a lot more ab
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90205
Jakub Jelinek changed:
What|Removed |Added
Status|UNCONFIRMED |ASSIGNED
Last reconfirmed|
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90205
--- Comment #1 from Andreas Schwab ---
%f is correct for double.
12 matches
Mail list logo