Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 16:02 Go to next message
Warren Tang is currently offline Warren TangFriend
Messages: 32
Registered: July 2009
Member
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 16:12 Go to previous messageGo to next message
Warren Tang is currently offline Warren TangFriend
Messages: 32
Registered: July 2009
Member
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 19: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] Sun, 30 March 2008 03:25 Go to previous messageGo to next message
Warren Tang is currently offline Warren TangFriend
Messages: 32
Registered: July 2009
Member
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 23:00 Go to previous messageGo to next message
Quan Vo is currently offline Quan VoFriend
Messages: 1
Registered: October 2012
Junior Member
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 23:14]

Report message to a 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 16:50 Go to previous messageGo to next message
saurabh agarwal is currently offline saurabh agarwalFriend
Messages: 3
Registered: November 2012
Junior Member
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 15:47 Go to previous messageGo to next message
Palmer Eldritch is currently offline Palmer EldritchFriend
Messages: 40
Registered: February 2011
Member
Is there an answer for this question ?

eclipse-kepler JEE
Win7 x64
Re: How to add the "-std=c99" option for gcc in Eclipse? [message #1741216 is a reply to message #1239615] Tue, 23 August 2016 18:43 Go to previous message
Martin Ferris is currently offline Martin FerrisFriend
Messages: 2
Registered: August 2016
Junior Member
This is the most useless, unhelpful forum I have ever found.
Previous Topic:Eclipse behaving strange
Next Topic:Preprocessor issues
Goto Forum:
  


Current Time: Tue Oct 15 09:32:02 GMT 2024

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

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

Back to the top