Show pageOld revisionsBacklinksBack to top This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. ===== Overview ===== Discussion of C11. Links: * [[https://smartbear.com/blog/test-and-monitor/c11-a-new-c-standard-aiming-at-safer-programming/|C11: A New C Standard Aiming at Safer Programming]] * [[http://bit.ly/C_Nutshell_2e|C in a Nutshell (2e)]] * [[https://www.oreilly.com/library/view/21st-century-c/9781491904428/|21st Century C]] * [[https://en.cppreference.com/w/c|cppreference.com]] ===== Fedora packages ===== * clang * valgrind * meld [for graphical diff] * strace; ltrace * splint * pkg-config * gdb; lldb ===== To document ===== * List the properties of "embedded C". ===== Internal links ===== * [[21st Century C]] * [[GCC extensions]] * [[SEI CERT C Coding Standard]] ===== DON'T CARE ===== * digraphs/trigraphs * "return"ing from main, no need as it's default return zero ===== NOTES ===== * simple language, most work done by library routines (standard + math) * "translation unit" * predefined identifier ''%%__func__%%'' * scopes: * file * block * function prototype * function ===== TOPICS ===== ==== Types ==== * scalar * arithmetic * basic * enums * pointers * aggregate * array * structure ==== Assertions ==== ==== Compound literals ==== ==== Generic selections ==== ==== Preprocessor ==== * ''#define'' ==== Threading ==== ==== Exit/abort ==== ==== setjmp/longjmp ==== ==== Atomic objects ==== ==== GNU extensions ==== * ''include_next'' ===== Static analyzers ===== ===== Libraries ===== * because C is a very simple language ===== TO DO ===== * ptrdiff_t, size_t * inline functions * flexible array/structure member * multi-threading * type-generic macros * variadic macros * assert(), static_assert(), _Static_assert() * new library functions(?) * ''include_next'' * compound literals * variadic functions (p. 127) * "restrict" type qualifier * offsetof() * generic selections (_Generic) * Define "embedded C". * syntactic analysers * setjmp/longjmp * exit/quick_exit/_Exit/at_exit/at_quick_exit ===== C11 features ===== ===== Reserved C keywords ===== <code> auto extern short while break float signed _Alignas case for sizeof _Alignof char goto static _Atomic const if struct _Bool continue inline switch _Complex default int typedef _Generic do long union _Imaginary double register unsigned _Noreturn else restrict void _Static_assert enum return volatile _Thread_local </code> ===== This and that ===== * name spaces * labels * tags (struct, union, enum) * struct or union members * all others * scopes * file * block * function prototype * function * GNU glibc contains: * standard library * math library * multi-threading * thread local * quick_exit() * anonymous structs/unions * type-generic functions * memory alignment control * _Noreturn function specifier * Unicode support * static assertions * bounds-checking functions ===== Types ===== * long long * _Bool (reserved keyword) ===== This and that ===== * declaration versus definition * no nested functions but can declare a function inside another one * wide versus multibyte characters * digraphs and trigraphs * scope: * file * block * prototype * function (includes labels) * alignment * _Alignof * _Alignas * ''%%__func__%%'' * generic selections * compound literals ===== Arrays ===== * element designators ===== Threads ===== * C11 threads versus POSIX threads (threads.h) c11.txt Last modified: 2019/08/05 13:31by rpjday