Search code examples
cgccc89

What are the set of options to pass to gcc when compiling C89 code


I know about -ansi -pedantic-errors

Is there any other options to be as defensive as possible, in my code? I mean I don't want to miss any warnings or anything.


Solution

  • If you don't want to miss any warnings or anything then, just use -std= switch. Use `-std=c89. Link gcc docs provided by GNU is having the information about different switch available. If you are using any other compiler then see the respective documents.