Jens Gustedt's Blog
programming in modern C
- Posts
- 123 from 1 Jun 2010 to 15 Feb 2026
- Posting
- now and then (1 in the last year)
- Kind
- personal blog
- Feed
- https://gustedt.wordpress.com/feed/
2026 1
2025 8
2024 8
- The C23 edition of Modern C
- Braiding the spaghetti: implementing defer in the preprocessor
- Tail recursion for macros in C
- EĿlipsis: a language independent preprocessor is released
- #include __FILE__
- All chapters of the C23 edition of Modern C now available in early access
- White space does matter in C23
- The deprecated attribute in C23 does much more than marking obsolescence
2023 4
2022 4
2021 3
2020 5
2019 2
2018 6
2017 4
2016 4
2015 4
2014 3
2013 6
2012 18
- inline functions as good as templates
- P99 futexes: non-blocking integer valued condition variables
- C11 defects: initialization of padding
- C11 defects: C threads are not realizable with POSIX threads
- named constants
- Capture return codes from library functions
- Drop out: there is not opt out button for dropbox
- type generic functions taking pointers or arrays
- struct tags in C++ are even weirder
- C11 defects: underspecification of tss_t
- C11 defects: initialization of atomic_flag
- C data model, simplified view
- the C data model
- try, throw and catch clauses with P99
- surprising occurrence of identifiers in header files
- Simple C11 atomics: atomic_flag
- Emulating C11 compiler features with gcc: _Atomic
- Emulating C11 compiler features with gcc: _Generic
2011 14
- emulating C11 threads through POSIX threads
- chasing a phantom: checking the return of malloc
- socket programming and C99
- Avoid writing va_arg functions
- Name mangling in C
- non-deterministic programs through unspecified behavior
- Statement unrolling with P99_FOR
- flexible array member
- C99 conformance test
- const and arrays
- Handling control flow inside macros
- linux futexes: non-blocking integer valued condition variables
- VLA as function arguments
- don’t be afraid of variably modified types
2010 29
- constant expressions
- assignment and initialization
- Myth and reality about inline in C99
- P99 is released
- Don’t use NULL
- A generic swap implementation
- Detecting integer overflow II
- Detecting integer overflow I
- Anatomy of integer types in C
- struct tags are not identifiers in C++
- Why sem_t is not suited as an atomic counter
- Macros versus inline functions
- Misnomers in C
- A common misconception: the register keyword
- Scope Bound Resource Management with for Scopes
- va_arg functions and macros
- Keyword overloading: the static keyword
- Avoiding name conflics for libraries
- how to make sem_t interrupt safe
- Semaphores and Mutexes aren’t so similar
- Integer type confusion
- Obfuscation or inventing a new operator tends to operator -->
- initialization of dynamically allocated struct
- Consistent initialization of static and auto variables
- Associativity of ##, double constants and preprocessor tokens
- Detect empty macro arguments
- Default arguments for C99
- Right shift on signed types is not well defined
- How many bits has a byte?