Setting std=c99 flag in GCC

CProgramming LanguagesC99

C Problem Overview


I was wondering if there were any files in which I could set the -std=c99 flag, so that I would not have to set it for every compilation. I am using GCC 4.4 on Ubuntu.

C Solutions


Solution 1 - C

Instead of calling /usr/bin/gcc, use /usr/bin/c99. This is the Single-Unix-approved way of invoking a C99 compiler. On an Ubuntu system, this points to a script which invokes gcc after having added the -std=c99 flag, which is precisely what you want.

Solution 2 - C

How about alias gcc99= gcc -std=c99?

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionFatmarikView Question on Stackoverflow
Solution 1 - CThomas PorninView Answer on Stackoverflow
Solution 2 - CdirkgentlyView Answer on Stackoverflow