Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > something about gcc3.4.2

Reply
Thread Tools

something about gcc3.4.2

 
 
usr.root@gmail.com
Guest
Posts: n/a
 
      12-21-2005
i have done a test like this with gcc3.4.2:
int main(){

for(int i =0;i<3;i++);

return 0;
}
if i complile my code without using -std=c99,it shows a message :'for'
loop initial declaration used outside C99 mode .
i wonder that if not use -std=c99,which std it compile with?how can i
find that out?
(if i use -std=c99,it's ok)

 
Reply With Quote
 
 
 
 
=?iso-8859-1?q?Dag-Erling_Sm=F8rgrav?=
Guest
Posts: n/a
 
      12-21-2005
"" <> writes:
> i wonder that if not use -std=c99, which std it compile with? how
> can i find that out?


GNU C, which can be more or less accurately described as C89 with
extensions.

The problem with declarations in the initialization part of a for loop
is that GCC had a similar feature with slightly different semantics
before it was standardized. Code that relies on those semantics will
either not compile or produce different results with -std=c99, so the
GCC maintainers have decided to deprecate the old extension.

DES
--
Dag-Erling Smørgrav -
 
Reply With Quote
 
 
 
 
Skarmander
Guest
Posts: n/a
 
      12-21-2005
Dag-Erling Smørgrav wrote:
> "" <> writes:
>
>>i wonder that if not use -std=c99, which std it compile with? how
>>can i find that out?

>
>
> GNU C, which can be more or less accurately described as C89 with
> extensions.
>

The full story can be found in the GCC manual:
http://gcc.gnu.org/onlinedocs/gcc-3....ialect-Options

S.
 
Reply With Quote
 
Keith Thompson
Guest
Posts: n/a
 
      12-21-2005
"" <> writes:
> i have done a test like this with gcc3.4.2:
> int main(){
>
> for(int i =0;i<3;i++);
>
> return 0;
> }
> if i complile my code without using -std=c99,it shows a message :'for'
> loop initial declaration used outside C99 mode .
> i wonder that if not use -std=c99,which std it compile with?how can i
> find that out?
> (if i use -std=c99,it's ok)


That's a question about gcc, not about the C language. You'll find
the answer in the extensive documentation that's provided with gcc.

--
Keith Thompson (The_Other_Keith) kst- <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
XPath query for <?define something="something" ?> Pekka Järvinen XML 2 04-29-2008 08:12 PM
How to find and replace something that is nested inside something else? alainfri@gmail.com Perl Misc 4 05-31-2007 11:50 PM
var Something= new Something() What does it mean ? pamelafluente@libero.it Javascript 9 10-05-2006 02:43 PM
Etching tutorials-or now for something completely different Technoholic Case Modding 71 09-27-2005 06:39 AM
umm... something... template(s)... something else... pointer(s)... and such... 0.o yah, I'm hopeless and clueless o.0 C++ 4 10-13-2004 10:34 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57