EnzoR
EnzoR

Reputation: 3346

GNU C Extensions documentation: where is it?

I know there are several language extensions added in the GNU C compiler (aka gcc). I can read something about that here.

What I'm looking for is deeper and wider documentation about those topics.

For example I'd like to read more about _Static_assert(), typeof and the likes.

Maybe it's just my fault, but I cannot find such an official documentation. Any hint? TIA!

Upvotes: 1

Views: 237

Answers (2)

hdante
hdante

Reputation: 8020

The answer is http://gcc.gnu.org/onlinedocs/gcc/C-Extensions.html and you're not finding about static assertions because it's not an extension of the C language, it's a core, built-in, standardized part of the language and described in the language international standards. In this case, refer to the C specification:

http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1570.pdf

See section 6.7.10 Static assertions, in particular paragraph 3:

"The constant expression shall be an integer constant expression. If the value of the constant expression compares unequal to 0, the declaration has no effect. Otherwise, the constraint is violated and the implementation shall produce a diagnostic message that includes the text of the string literal, except that characters not in the basic source character set are not required to appear in the message."

Upvotes: 3

Christian Garbin
Christian Garbin

Reputation: 2532

Here: http://gcc.gnu.org/onlinedocs/gcc/C-Extensions.html.

Use Google to search inside gnu.org. Found it by typing this search in Google: c extensions site:gnu.org.

Upvotes: 1

Related Questions