Extensions to the C Language – GCC and Sunstudio

My previous blog "C99 new feature: 指定初始化 ( designated initializer )" mentioned one of C99 new feature. Here are more extensions C language, for GNU gcc and Sunstudio.

GNU C:
GNU C provides several language features not found in ISO standard C.
(The -pedantic option directs GCC to print a warning message if
any of these features is used.) To test for the availability of these
features in conditional compilation, check for a predefined macro
__GNUC__, which is always defined under GCC.
These extensions are available in C and Objective-C. Most of them are
also available in C++. See Extensions to the C++ Language, for extensions that apply only to C++.
Some features that are in ISO C99 but not C89 or C++ are also, as
extensions, accepted by GCC in C89 mode and in C++.
See more details click here

Sunstudio C 12
New Language Extensions in the Sun Studio 12 C Compiler
This article gives an overview of the following C-language
extensions (part of the GNU C-implementation) introduced in the Sun
Studio 12 C compiler. Although these extensions are not part of the
latest ISO C99 standard, they are supported by the popular gcc
compilers.

  • The typeof keyword which allows references to an
    arbitrary type
  • Statement expressions that make it possible to specify
    declarations and statements in expressions
  • Block-scope label names

发表评论

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / 更改 )

Twitter picture

You are commenting using your Twitter account. Log Out / 更改 )

Facebook photo

You are commenting using your Facebook account. Log Out / 更改 )

Google+ photo

You are commenting using your Google+ account. Log Out / 更改 )

Connecting to %s