Search code examples
ceclipsegccansi-c

Compile C codes with ANSI in Eclipse


I need my code to be fully up to ANSI standards like using this command line in Unix System:

gcc -ansi -Wall -pedantic code.c -o code...

How can I (manually) compile my code with those standards or is there any settings in Eclipse that can achieve this standard?

Thank you very much!


Solution

  • Go to Project\Properties\C/C++ Build\Settings

    Then find:

    'Miscellaneous' and check 'Support ANSI Programs', 'Warnings' and check 'Pedantic', 'Pedantic warnings as error', 'All warnings', 'Debugging' and choose preferred debug standards, 'Optimisations' then select any level.