Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does -Wall flag do when I compile it with the program?

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)

like image 671
Andreas Hadjigeorgiou Avatar asked Apr 23 '26 09:04

Andreas Hadjigeorgiou


1 Answers

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.

like image 101
Mahmoud Fayez Avatar answered Apr 26 '26 19:04

Mahmoud Fayez



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!