User Tools

Site Tools


c11

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
c11 [2019/06/10 11:48]
rpjday [Threads]
c11 [2019/08/05 13:31] (current)
rpjday [Internal links]
Line 7: Line 7:
   * [[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]]   * [[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)]]   * [[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 ===== ===== 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''​   * ''​include_next''​
   * compound literals   * compound literals
   * variadic functions (p. 127)   * 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 ===== ===== Reserved C keywords =====
  
 <​code>​ <​code>​
-auto extern short while +auto      extern ​   short     ​while 
-break float signed _Alignas +break     ​float     ​signed ​   _Alignas 
-case for sizeof _Alignof +case      for       ​sizeof ​   _Alignof 
-char goto static _Atomic +char      goto      static ​   _Atomic 
-const if struct _Bool +const     ​if        struct ​   _Bool 
-continue inline switch _Complex +continue ​ inline ​   switch ​   _Complex 
-default int typedef _Generic +default ​  ​int       ​typedef ​  ​_Generic 
-do long union _Imaginary +do        long      union     ​_Imaginary 
-double register unsigned _Noreturn +double ​   register ​ unsigned ​ _Noreturn 
-else restrict void _Static_assert +else      restrict ​ void      _Static_assert 
-enum return volatile _Thread_local+enum      return ​   volatile ​ _Thread_local
 </​code>​ </​code>​
  
-===== Salient features ​=====+===== 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   * multi-threading
     * thread local     * thread local
Line 62: Line 171:
     * _Alignof     * _Alignof
     * _Alignas     * _Alignas
 +  * ''​%%__func__%%''​
   * generic selections   * generic selections
   * compound literals   * compound literals
Line 70: Line 180:
  
 ===== Threads ===== ===== Threads =====
 +
 +  * C11 threads versus POSIX threads (threads.h)
  
  
c11.1560167296.txt.gz · Last modified: 2019/06/10 11:48 by rpjday