Assuming you are using Eclipse's internal builder goto Preferences->C/C++ Build->Settings
Choose the warnings section for the compiler, there are tick boxes for -Wall and -pedantic
For -ansi set in Miscellaneous
As the OP notes this is just for each project not a global setting
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…