Wandbox
SettingsLog
SettingsLog
Language
GitHubLogin
Ran/Viewed Log

Author

anonymous

about 5 years ago

Language

C

Compiler

gcc 9.2.0

Options
Warnings
C11(GNU)
no pedantic
Raw compiler options
-Werror

Author

anonymous

about 5 years ago

$ gcc prog.c -Wall -Wextra -std=gnu11 -Werror
prog.c:4:1: error: return type defaults to 'int' [-Werror=implicit-int]
    4 | main()
      | ^~~~
prog.c: In function 'main':
prog.c:15:75: error: format '%d' expects argument of type 'int *', but argument 2 has type 'int' [-Werror=format=]
   15 |     printf("\nDeseja calcular novamente?\n 1 - SIM\n 2 - NAO\n"); scanf("%d", op);
      |                                                                          ~^   ~~
      |                                                                           |   |
      |                                                                           |   int
      |                                                                           int *
prog.c:6:19: error: unused variable 'n3' [-Werror=unused-variable]
    6 |     float n1, n2, n3, m;
      |                   ^~
prog.c:15:67: error: 'op' is used uninitialized in this function [-Werror=uninitialized]
   15 |     printf("\nDeseja calcular novamente?\n 1 - SIM\n 2 - NAO\n"); scanf("%d", op);
      |                                                                   ^~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
Exit Code:
1