https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98819

--- Comment #2 from Jonny Grant <jg at jguk dot org> ---
(In reply to Andrew Pinski from comment #1)
> I think you misunderstood the diagnostic.  It is saying unsigned int is for
> %u.  The type you have is int.

Ah, is that "%u" not the suggestion?


Change it to %f and it gives the clear "%d" suggestion I expected for my int



#1 with x86-64 gcc (trunk)
<source>: In function 'int main()':
<source>:6:19: warning: format '%f' expects argument of type 'double', but
argument 2 has type 'int' [-Wformat=]
    6 |     std::printf("%f", CURRENT_YEAR);
      |                  ~^
      |                   |
      |                   double
      |                  %d
Compiler returned: 0

Reply via email to