7

I am following a tutorial that says how to profile the program using gprof and the command given is like this

gcc -Wall -pg test_gprof.c test_gprof_new.c -o test_gprof

But it doesn'y give any explanation for this flag (-Wall)

  • The explanations of GCC's commandline options are in [the GCC manual](https://gcc.gnu.org/onlinedocs/gcc-8.3.0/gcc/Invoking-GCC.html#Invoking-GCC). You can find the part of the manual you need to read for `-Wall` or any other option by looking in the [Option Summary](https://gcc.gnu.org/onlinedocs/gcc-8.3.0/gcc/Option-Summary.html#Option-Summary) – Mike Kinghan Mar 04 '19 at 15:11
  • Does this answer your question? [What does "-Wall" in "g++ -Wall test.cpp -o test" do?](https://stackoverflow.com/questions/2408038/what-does-wall-in-g-wall-test-cpp-o-test-do) – ggorlen Feb 23 '20 at 00:32

1 Answers1

9

As the name suggests it tells the compiler to enable all warning messages i.e. unused variables. This would help you to write better and clean code.

Mahmoud Fayez
  • 3,398
  • 2
  • 19
  • 36