Comment

Comment by comex

If you use GCC, enable -Wall and you'll get the diagnostic you want:

    /tmp/cp.c: In function 'main':
    /tmp/cp.c:4:1: warning: control reaches end of non-void function [-Wreturn-type]
        4 | }
          | ^
If you use Clang, there is no diagnostic even with -Wall (or even -Weverything), but it looks like Clang always implements the implicit `return 0;` from C99 regardless of the `-std` setting.
parent comex 5 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton