GCC's printf annotation can give you compile-time safety.
You can get run-time type checking in C using C99 variadic macros and C11 _Generic expressions. Here's a proof-of-concept I threw together earlier this year in a moment of boredom. I only tested it with a few versions of clang and GCC.
1 comment
[ 3.8 ms ] story [ 15.7 ms ] threadYou can get run-time type checking in C using C99 variadic macros and C11 _Generic expressions. Here's a proof-of-concept I threw together earlier this year in a moment of boredom. I only tested it with a few versions of clang and GCC.