Wandbox
SettingsLog
SettingsLog
Language
GitHubLogin
Ran/Viewed Log

Author

anonymous

over 6 years ago

Language

C

Compiler

gcc HEAD 9.0.0 20190109 (experimental)

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

Author

anonymous

over 6 years ago

$ gcc prog.c -Wall -Wextra -std=gnu11 -Werror
prog.c: In function 'doStuff':
prog.c:4:17: error: unused parameter 'pA' [-Werror=unused-parameter]
    4 | void doStuff(A* pA) {};
      |              ~~~^~
prog.c: In function 'main':
prog.c:8:12: error: passing argument 1 of 'doStuff' from incompatible pointer type [-Werror=incompatible-pointer-types]
    8 |    doStuff(&b);
      |            ^~
      |            |
      |            B * {aka struct B *}
prog.c:4:17: note: expected 'A *' {aka 'struct A *'} but argument is of type 'B *' {aka 'struct B *'}
    4 | void doStuff(A* pA) {};
      |              ~~~^~
cc1: all warnings being treated as errors
Exit Code:
1