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)
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.
-Wall
or any other option by looking in the Option Summary