Enabling flags (Wall, pedantic) for compiling C / C ++ in Eclipse

I am using Eclipse to write C / C ++ programs. I would like to compile my code using the -Wall and -pedantic flags. How do I enable these flags in Eclipse so that they are used by default whenever I compile a C / C ++ program?

+3


source to share


1 answer


Go to Eclipse -> Project Explorer -> your project -> context menu -> Properties.

A dialog box will appear. In the left pane, open "C / C ++ Build" -> Preferences. In the right pane, make sure the Tool Settings tab is selected -> Under GCC C ++ Compiler, select Warnings -> check the boxes you want.



In your case, you want "Pedantic (-pedantic)". "All warnings (-Wall)" should be checked by default. You may need "Additional Warnings (-Wextra)" (alias "-W").

0


source







All Articles