Compiler support of GNU Statement Expression
The PathScale® EKOPath Compiler Suite It support gnu99 with “−std=gnu99“
The PathScale® EKOPath Compiler Suite It support gnu99 with “−std=gnu99“
A compound literal is an lvalue and values of its elements are modifiable. In case of char* str = (char[]){“Hello World”}; *str=”B”; // A-Okay! you are modifying a compound literal which is legal. C11-§6.5.2.5/4: If the type name specifies an array of unknown size, the size is determined by the initializer list as specified in … Read more
An enum is guaranteed to be represented by an integer, but the actual type (and its signedness) is implementation-dependent. You can force an enumeration to be represented by a signed type by giving one of the enumerators a negative value: enum SignedEnum { a = -1 }; In C++0x, the underlying type of an enumeration … Read more
It’s undefined behaviour, because it breaks a “shall” constraint: C99 §6.7.5.2: If the size is an expression that is not an integer constant expression… …each time it is evaluated it shall have a value greater than zero.
The conversion of a value to signed int is implementation-defined (as you correctly mentioned because of 6.3.1.3p3) . On some systems for example it can be INT_MAX (saturating conversion). For gcc the implementation behavior is defined here: The result of, or the signal raised by, converting an integer to a signed integer type when the … Read more
In 4. “Conformance” §6, there is: A conforming implementation may have extensions (including additional library functions), provided they do not alter the behavior of any strictly conforming program. with the immediate conclusion in a footnote: This implies that a conforming implementation reserves no identifiers other than those explicitly reserved in this International Standard. The reserved … Read more
Variable length arrays were added to C99. It’s described in the C99 rationale: 6.7.5.2 Array declarators C99 adds a new array type called a variable length array type. The inability to declare arrays whose size is known only at execution time was often cited as a primary deterrent to using C as a numerical computing … Read more
on long int long int is supposed to be AT LEAST 32-bits, but C99 standard does NOT limit it to 32-bit. C99 standard does provide convenience types like int16_t & int32_t etc that map to correct bit sizes for a target platform. on ftell/fseek ftell() and fseek() are limited to 32 bits (including sign bit) … Read more
Turbo C is a DOS only product. This means that it no longer runs “natively” on 64-bit versions of Windows, and must be run inside the XP compatibility penalty box.
The only ‘modes’ supported by Visual C++ are: /std:c++14 mode for C++14 conformance (the default), /std:c++17 mode for C++17 support which is not quite complete as of VS 2017 (15.6). There is also a /std:c++latest mode which at some future point will include things in C++20. All of these should be combined with /permissive- for … Read more