tags:

views:

99

answers:

2

Hi:

I already read the FAQ, and i think maybe this is a subjective question, but i need to ask. Does anyine knows what exactly (i mean formally) is a C++ language extensions.

I already saw examples, like nvdia CUDA c ext, Avalon transaction-based c++ ext.

So the point is something like a formal definition or so.

thxs anyway.

A: 

Please see Extensible programming:

Extensible programming is a term used in computer science to describe a style of computer programming that focuses on mechanisms to extend the programming language, compiler and runtime environment.

and more to the point, the Extensible syntax section:

This simply means that the source language(s) to be compiled must not be closed, fixed, or static. It must be possible to add new keywords, concepts, and structures to the source language(s).

Andrew Hare
-1 Question is not about extensible programming, but normal extensions.
Marco van de Voort
+3  A: 

A language extension is simply anything that goes beyond what the language specification calls for. Your compiler might add new features, like special "min" and "max" operators. Your compiler might define the behavior of division by zero, which is otherwise undefined, according to the standard. It might provide additional parameters for your main function. It might be the incorporation of another language's features, such as allowing C-style variable-sized arrays in C++. It might be a facility for specifying a function's calling convention.

Using a language extension usually makes your code non-portable because when you take your code to another OS, compiler, or even compiler version, the extension may not be available anymore, or its behavior may be different from what you had originally used.

Rob Kennedy