Wandbox
SettingsLog
SettingsLog
Language
GitHubLogin
Ran/Viewed Log

Author

anonymous

almost 4 years ago

Language

C

Compiler

gcc 11.1.0

Options
Warnings
C11(GNU)
no pedantic

Author

anonymous

almost 4 years ago

$ gcc prog.c -Wall -Wextra -std=gnu11
prog.c: In function 'main':
prog.c:4:18: warning: format '%d' expects argument of type 'int', but argument 2 has type 'double' [-Wformat=]
    4 |     printf("int=%d, double=%f\n", 3.1416, 42);
      |                 ~^                ~~~~~~
      |                  |                |
      |                  int              double
      |                 %f
prog.c:4:29: warning: format '%f' expects argument of type 'double', but argument 3 has type 'int' [-Wformat=]
    4 |     printf("int=%d, double=%f\n", 3.1416, 42);
      |                            ~^             ~~
      |                             |             |
      |                             double        int
      |                            %d
int=42, double=3.141600
Exit Code:
0