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: Jean-Daniel Dupas <email@hidden>
- Date: Fri, 1 Feb 2008 09:34:49 +0100
Le 31 janv. 08 à 18:57, Andrew Merenbach a écrit :
Hi, all,
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"
(from http://gcc.gnu.org/onlinedocs/gcc-4.2.2/gcc/Standards.html#Standards) _______________________________________________
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