|
|
bar.c: In function ‘main’: bar.c:7:2: warning: format ‘%d’ expects argument of type ‘int *’, but argument 2 has type ‘double *’ [-Wformat=] bar.c:12:2: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘double’ [-Wformat=] bar.c:13:2: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘double’ [-Wformat=] bar.c:16:1: warning: control reaches end of non-void function [-Wreturn-type] |
|
|
Standard wrote: |
---|
§ 3.6.1 A return statement in main has the effect of leaving the main function (destroying any objects with automatic storage duration) and calling std::exit with the return value as the argument. If control reaches the end of main without encountering a return statement, the effect is that of executing return 0; |
If control reaches the end of main without encountering a return statement, the effect is that of executing return 0; |
c89
would give the warning; c99
and c1x
won't.gnu89
’ - an amorphous mixture of mostly C89, bits and pieces of C99, and a bunch of non-standard linuxisms.