forked from cil-project/cil
-
Couldn't load subscription status.
- Fork 21
Open
Labels
Description
CIL lacks support for various additions to the C language that come with the C11 specification. It would be beneficial to identify and implement features to improve CIL's support for C11.
To check/implement from wiki/C11:
- Alignment specification (
_Alignasspecifier,_Alignofoperator,aligned_allocfunction,<stdalign.h>header file). - The
_Noreturnfunction specifier and the<stdnoreturn.h>header file. - Type-generic expressions using the
_Generickeyword. For example, the following macrocbrt(x)translates tocbrtl(x),cbrt(x)orcbrtf(x)depending on the type of x:#define cbrt(x) _Generic((x), long double: cbrtl, \ default: cbrt, \ float: cbrtf)(x)
- Multi-threading support (
_Thread_localstorage-class specifier,<threads.h>header including thread creation/management functions, mutex, condition variable and thread-specific storage functionality, as well as<stdatomic.h>for atomic operations supporting the C11 memory model). - Improved Unicode support based on the C Unicode Technical Report ISO/IEC TR 19769:2004 (
char16_tandchar32_ttypes for storing UTF-16/UTF-32 encoded data, including conversion functions in<uchar.h>and the correspondinguandUstring literal prefixes, as well as theu8prefix for UTF-8 encoded literals). - Removal of the gets function, deprecated in the previous C language standard revision, ISO/IEC 9899:1999/Cor.3:2007(E).
- Bounds-checking interfaces (Annex K). (Nothing to be done, GCC chose not to implement it)
- Analyzability features (Annex L). (Nothing to be done, GCC chose not to implement it)
- More macros for querying the characteristics of floating point types, concerning subnormal floating point numbers and the number of decimal digits the type is able to store.
- Anonymous structures and unions, useful when unions and structures are nested, e.g. in
struct T { int tag; union { float x; int n; }; };. - Static assertions, which are evaluated during translation at a later phase than
#ifand#error, when types are understood by the translator. - An exclusive create-and-open mode (
"…x"suffix) for fopen. This behaves likeO_CREAT|O_EXCLin POSIX, which is commonly used for lock files. - The
quick_exitfunction as a third way to terminate a program, intended to do at least minimal deinitialization if termination with exit fails. - A new
timespec_getfunction and corresponding structure in<time.h>with a degree of POSIX compatibility. - Macros for the construction of complex values (partly because
real + imaginary*Imight not yield the expected value ifimaginaryis infinite or NaN).
michael-schwarz and jerhard