Skip to main content



      Home
Home » Language IDEs » C / C++ IDE (CDT) » How to add the "-std=c99" option for gcc in Eclipse?
How to add the "-std=c99" option for gcc in Eclipse? [message #212981] Sat, 29 March 2008 12:02 Go to next message
Eclipse UserFriend
Hello,

I need to use some C99 features but I have to add the -std=c99 option
for gcc. So how can I add this option in Eclipse?

Thanks!
(Sorry for my first mail got the wrong place, so I repost it.)

Regards
Warren Tang
Re: How to add the "-std=c99" option for gcc in Eclipse? [message #212988 is a reply to message #212981] Sat, 29 March 2008 12:12 Go to previous messageGo to next message
Eclipse UserFriend
For example, when I wrote this code:
for(int i = 0; i < 10; i++) {}

The gcc compiler complained that
‘for’ loop initial declaration used outside C99 mode
Re: How to add the "-std=c99" option for gcc in Eclipse? [message #213011 is a reply to message #212988] Sat, 29 March 2008 15:17 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: newsgroups.snipah.com

Warren Tang wrote:
> For example, when I wrote this code:
> for(int i = 0; i < 10; i++) {}
>
> The gcc compiler complained that
> ‘for’ loop initial declaration used outside C99 mode
>
Hi Warren,

Simply open the project preferences and add -std=c99 to Settings/C
Compiler/Miscellaneous/Other Flags

Enrico
Re: How to add the "-std=c99" option for gcc in Eclipse? [message #213033 is a reply to message #213011] Sat, 29 March 2008 23:25 Go to previous messageGo to next message
Eclipse UserFriend
Enrico Ehrich wrote:
> Warren Tang wrote:
>> For example, when I wrote this code:
>> for(int i = 0; i < 10; i++) {}
>>
>> The gcc compiler complained that
>> ‘for’ loop initial declaration used outside C99 mode
>>
> Hi Warren,
>
> Simply open the project preferences and add -std=c99 to Settings/C
> Compiler/Miscellaneous/Other Flags
>
> Enrico
>

Hi, Enrico

Thanks you very much! I found it there finally.

Warren
Re: How to add the "-std=c99" option for gcc in Eclipse? [message #940724 is a reply to message #212981] Thu, 11 October 2012 19:00 Go to previous messageGo to next message
Eclipse UserFriend
Sorry to bring this back from the dead, but I was wondering if you knew how to do this with the current version of Eclipse and CDT.

SOLVED:
Project -> Properties
C/C++ Build -> Settings -> Tool Settings -> (Cygwin C Compiler) -> Miscellaneous
Other flags (a text field)

Note that I'm using Cygwin and you may have something different.

[Updated on: Thu, 11 October 2012 19:14] by Moderator

Re: How to add the "-std=c99" option for gcc in Eclipse? [message #980406 is a reply to message #940724] Sun, 11 November 2012 11:50 Go to previous messageGo to next message
Eclipse UserFriend
Is there any method of changing default flags of gcc compiler in Eclipse? I wish to apply the flag -std=c99 to all the c projects by default I create, instead of applying it project by project?

thanks in advance
Re: How to add the "-std=c99" option for gcc in Eclipse? [message #1239615 is a reply to message #980406] Tue, 04 February 2014 10:47 Go to previous messageGo to next message
Eclipse UserFriend
Is there an answer for this question ?
Re: How to add the "-std=c99" option for gcc in Eclipse? [message #1741216 is a reply to message #1239615] Tue, 23 August 2016 14:43 Go to previous message
Eclipse UserFriend
This is the most useless, unhelpful forum I have ever found.
Previous Topic:Eclipse behaving strange
Next Topic:Preprocessor issues
Goto Forum:
  


Current Time: Mon Apr 28 22:40:14 EDT 2025

Powered by FUDForum. Page generated in 0.09182 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top