Enabling flags (Wall, pedantic) for compiling C / C ++ in Eclipse
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").
source to share