Re: Declarations in middle of C code?!
Re: Declarations in middle of C code?!
- Subject: Re: Declarations in middle of C code?!
- From: Charles Srstka <email@hidden>
- Date: Sun, 4 Jan 2004 18:00:08 -0600
Yeah, I guess that was the reason - I was using gcc 2.9.5 when I was
using 10.2.
Anyway, thanks for the info. Does anyone know whether using this new
feature the way it is commonly used in C++ is considered good style for
C code? Or is it better just to keep coding the old way, using this
ability only to insert logs in places where it would normally not be
possible?
Thanks,
Charles
On Jan 4, 2004, at 5:39 PM, Christopher Corbell wrote:
On Jan 4, 2004, at 2:24 PM, Charles Srstka wrote:
I thought this was not supposed to work in straight C code? This most
certainly did *not* work with Project Builder under 10.2, but with
XCode and gcc 3.3, I can write this code:
Just a minor correction, this *did* work in PB under 10.2 if you were
using gcc 3. It only failed under gcc 2.9.5 (the original dev tools
compiler). I believe projects created with the older compiler (e.g.
under 10.1.x) would remain gcc 2.9.5 projects unless you explicitly
changed this in gcc settings.
There were some situations where upgrading gcc (e.g. from 3.1 to 3.3)
would cause a project created under 10.2/gcc 3 to "revert" to 2.9.5 as
the default compiler, breaking C99 code like this, but again this was
easily fixed by explicitly setting the gcc version in PB. I believe
there
was a release note relating to this with the gcc 3.3 upgrade.
- Christopher
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.