The Curious Engineer

All blogs / C

Jens Gustedt's Blog

gustedt.wordpress.com

programming in modern C

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

  1. Defer available in gcc and clang

2025 8

  1. Alias and references as localized macros
  2. Modern C, C23 edition, now in print
  3. The provenance memory model for C
  4. Make C string literals const?
  5. A diagram of C23 basic types
  6. Contracts for C
  7. Preprocessor meta-quotes with eĿlipsis
  8. Simple defer, ready to use

2024 8

  1. The C23 edition of Modern C
  2. Braiding the spaghetti: implementing defer in the preprocessor
  3. Tail recursion for macros in C
  4. EĿlipsis: a language independent preprocessor is released
  5. #include __FILE__
  6. All chapters of the C23 edition of Modern C now available in early access
  7. White space does matter in C23
  8. The deprecated attribute in C23 does much more than marking obsolescence

2023 4

  1. Early access to the C23 edition of Modern C
  2. The fediverse is watching
  3. The new __VA_OPT__ feature in C23
  4. Enforced bounds checking for frozen function interfaces

2022 4

  1. Dealing with overflow
  2. Checked integer arithmetic in the prospect of C23
  3. C23 implications for C libraries
  4. A defer feature using lambda expressions

2021 3

  1. type-safe parametric polymorphism
  2. Feature freeze for C23
  3. Improve type generic programming

2020 5

  1. A defer mechanism for C
  2. C source-to-source compiler enhancement from within
  3. An interview on Software Engineering Radio on Modern C
  4. A Common C/C++ Core Specification rev 2
  5. A common C/C++ core specification

2019 2

  1. the floating point naming explosion
  2. Modern C, Second Edition

2018 6

  1. Spurious failures of thread functions
  2. compare exchange compares memory and not value
  3. C17: reformulations for atomic_flag
  4. C17 obsoletes ATOMIC_VAR_INIT
  5. C17: rvalues and function types drop qualifiers
  6. C17

2017 4

  1. cross-language interfaces between C and C++
  2. gcc doesn’t inline position independent code properly
  3. Unicode operators for C
  4. Update on Modular C

2016 4

  1. Modern C is now feature complete
  2. Ease the transition between C standards
  3. Effective types and aliasing
  4. Improving the specification of arithmetic for atomics

2015 4

  1. Modular C
  2. The controlling expression of _Generic
  3. Demystify undefined behavior
  4. Modern C: Level 2 available

2014 3

  1. musl 1.1.5 with full C11 library support
  2. Don’t use fake matrices
  3. Don’t use casts

2013 6

  1. right angle brackets: shifting semantics
  2. A disimprovement observed from the outside: right angle brackets
  3. different times in C: calendar times
  4. testing compile time constness and null pointers with C11’s _Generic
  5. a praise of size_t and other unsigned types
  6. Runtime-constraint violations

2012 18

  1. inline functions as good as templates
  2. P99 futexes: non-blocking integer valued condition variables
  3. C11 defects: initialization of padding
  4. C11 defects: C threads are not realizable with POSIX threads
  5. named constants
  6. Capture return codes from library functions
  7. Drop out: there is not opt out button for dropbox
  8. type generic functions taking pointers or arrays
  9. struct tags in C++ are even weirder
  10. C11 defects: underspecification of tss_t
  11. C11 defects: initialization of atomic_flag
  12. C data model, simplified view
  13. the C data model
  14. try, throw and catch clauses with P99
  15. surprising occurrence of identifiers in header files
  16. Simple C11 atomics: atomic_flag
  17. Emulating C11 compiler features with gcc: _Atomic
  18. Emulating C11 compiler features with gcc: _Generic

2011 14

  1. emulating C11 threads through POSIX threads
  2. chasing a phantom: checking the return of malloc
  3. socket programming and C99
  4. Avoid writing va_arg functions
  5. Name mangling in C
  6. non-deterministic programs through unspecified behavior
  7. Statement unrolling with P99_FOR
  8. flexible array member
  9. C99 conformance test
  10. const and arrays
  11. Handling control flow inside macros
  12. linux futexes: non-blocking integer valued condition variables
  13. VLA as function arguments
  14. don’t be afraid of variably modified types

2010 29

  1. constant expressions
  2. assignment and initialization
  3. Myth and reality about inline in C99
  4. P99 is released
  5. Don’t use NULL
  6. A generic swap implementation
  7. Detecting integer overflow II
  8. Detecting integer overflow I
  9. Anatomy of integer types in C
  10. struct tags are not identifiers in C++
  11. Why sem_t is not suited as an atomic counter
  12. Macros versus inline functions
  13. Misnomers in C
  14. A common misconception: the register keyword
  15. Scope Bound Resource Management with for Scopes
  16. va_arg functions and macros
  17. Keyword overloading: the static keyword
  18. Avoiding name conflics for libraries
  19. how to make sem_t interrupt safe
  20. Semaphores and Mutexes aren’t so similar
  21. Integer type confusion
  22. Obfuscation or inventing a new operator tends to operator -->
  23. initialization of dynamically allocated struct
  24. Consistent initialization of static and auto variables
  25. Associativity of ##, double constants and preprocessor tokens
  26. Detect empty macro arguments
  27. Default arguments for C99
  28. Right shift on signed types is not well defined
  29. How many bits has a byte?