0

I know that we use -g flag for storing the output to debug a C code, but what is the use of -Wall when compiling it?

  • 1
    Easy: Not making stupid mistakes because the compiler will warn you (`-W`) about `all` potential problems. Not literally all, but the most important ones anyway. – tadman Feb 22 '20 at 23:27
  • Also useful: https://stackoverflow.com/questions/11714827/how-to-turn-on-literally-all-of-gccs-warnings – ggorlen Feb 23 '20 at 00:34

1 Answers1

1

It enables most of the compiler's warning messages. See https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html.

Eraklon
  • 4,206
  • 2
  • 13
  • 29