Re: Why is C99 not enabled by default?
Re: Why is C99 not enabled by default?
- Subject: Re: Why is C99 not enabled by default?
- From: Chris Espinosa <email@hidden>
- Date: Fri, 1 Feb 2008 08:57:01 -0800
On Feb 1, 2008, at 12:34 AM, Jean-Daniel Dupas wrote:
My question is per the subject of this e-mail: why is C99 not
enabled by default in Objective-C projects? It seems more
"modern," or at least more "convenient," what with the ability to
declare variables in for-loops and whatnot. I've seen list
postings that say that it's "fine" or "okay" to use C99 in Cocoa
projects, without conflicts -- but *why* is never answered, from
what I can tell.
One of the documentation files has the following:
Imagine that you are working on a C program under Xcode. During
development, you learn that the program must be portable to
systems that support only pre-C99 language compliance, both GNU
and non-GNU compilers. As a result, your code cannot contain C99-
specific language features.
Because the default standard tool build uses the GNU89 language
dialect, you are confident that your code will work well under
these compilers. Unfortunately, this is not the case. For example,
imagine your code base contains variable-length automatic arrays,
as shown in Listing 3.
So I might infer that the lack of default C99 compliance is for
compatible, multi-platform C code. Is that the case?
I don't know why it is not enabled in Xcode's templates, but I know
why GCC does not use it by default:
"The default, if no C language dialect options are given, is -
std=gnu89; this will change to -std=gnu99 in some future release
when the C99 support is complete. Some features that are part of the
C99 standard are accepted as extensions in C89 mode"
C99 will be the default dialect in the next compiler version, so
projects moving to this compiler can take advantage of C99 features
but projects remaining on gcc 4.0 will not be affected.
Chris
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden