[Bug c++/90205] Wformat-signedness detects %d and suggests %d fixit hint

2022-12-26 Thread jg at jguk dot org via Gcc-bugs
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

[Bug c++/90205] Wformat-signedness detects %d and suggests %d fixit hint

2022-12-26 Thread jg at jguk dot org via Gcc-bugs
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

[Bug c++/90205] Wformat-signedness detects %d and suggests %d fixit hint

2019-10-23 Thread egallager at gcc dot gnu.org
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...

[Bug c++/90205] Wformat-signedness detects %d and suggests %d fixit hint

2019-04-23 Thread tavianator at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90205 Tavian Barnes changed: What|Removed |Added CC||tavianator at gmail dot com --- Comment

[Bug c++/90205] Wformat-signedness detects %d and suggests %d fixit hint

2019-04-23 Thread egallager at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90205 Eric Gallager changed: What|Removed |Added CC||egallager at gcc dot gnu.org --- Comment

[Bug c++/90205] Wformat-signedness detects %d and suggests %d fixit hint

2019-04-23 Thread jg at jguk dot org
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'

[Bug c++/90205] Wformat-signedness detects %d and suggests %d fixit hint

2019-04-23 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90205 Jakub Jelinek changed: What|Removed |Added Status|ASSIGNED|NEW CC|

[Bug c++/90205] Wformat-signedness detects %d and suggests %d fixit hint

2019-04-22 Thread redi at gcc dot gnu.org
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

[Bug c++/90205] Wformat-signedness detects %d and suggests %d fixit hint

2019-04-22 Thread jg at jguk dot org
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() {

[Bug c++/90205] Wformat-signedness detects %d and suggests %d fixit hint

2019-04-22 Thread jg at jguk dot org
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

[Bug c++/90205] Wformat-signedness detects %d and suggests %d fixit hint

2019-04-22 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90205 Jakub Jelinek changed: What|Removed |Added Status|UNCONFIRMED |ASSIGNED Last reconfirmed|

[Bug c++/90205] Wformat-signedness detects %d and suggests %d fixit hint

2019-04-22 Thread sch...@linux-m68k.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90205 --- Comment #1 from Andreas Schwab --- %f is correct for double.