User Tools

Site Tools


c11

This is an old revision of the document!


Overview

Figure out

  • What is “embedded C”?

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

  • include_next

Threading

Exit/abort

setjmp/longjmp

Static analyzers

Libraries

TO DO

  • ptrdiff_t, size_t
  • inline functions
  • multi-threading
  • type-generic macros
  • variable-length macros
  • assert(), static_assert(), _Static_assert()
  • new library functions(?)
  • include_next
  • compound literals
  • variadic functions (p. 127)
  • “restrict” type qualifier
  • generic selections (_Generic)
  • Define “embedded C”.
  • syntactic analysers
  • setjmp/longjmp
  • exit/quick_exit/_Exit/at_exit/at_quick_exit

C11 features

Reserved C keywords

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

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.1563395409.txt.gz · Last modified: 2019/07/17 20:30 by rpjday