What compiler options are recommended for beginners learning C?
When reading questions about C programming from beginners, I very often see them describing peculiar run-time errors and crashes, segmentation faults and similar. They have spent a lot of time chasing down the bug but failed.
Then upon viewing their code, I notice that the code should never have "compiled cleanly" - there were warnings, but the beginner didn't read them. If they had done so, it would have saved them a lot of time.
Not reading warnings could in turn be caused by the IDE used hiding away warnings in some hard-to-spot window, or because they picked some "compile & run" option, or simply because they weren't paying attention.
Or possibly because they think that warnings mean "here's a little cosmetic issue that you should fix when you have time", and not "here is a severe bug that will likely prevent your program from working as expected" which is closer to the truth most of the time.
Unfortunately, a compiler isn't required to give an error upon C language violations. A "diagnostic message" is sufficient, as discussed at What must a C compiler do when it finds an error?.
Are there any recommended compiler options beginners should use to avoid accidentally running programs with errors already spotted by the compiler?
Mostly interested in the "gcc-like" mainstream compilers: gcc, clang and icc, which have compatible command-line options.