gcc enables the warnings with -Wformat, but the association between varargs function and format checking is done by the following (on FreeBSD): int asprintf __P((char **, const char *, ...)) __printflike(2, 3); where #define __printflike(fmtarg, firstvararg) \ __attribute__((__format__ (__printf__, fmtarg, firstvararg))) it's the __attribute__ cluster that's built-in to gcc. Linux uses different #defines but the result is similar. hence the need for ifdefs somewhere to avoid feeding __stuff__ to other compilers. (there are many many more __things__.) the list of formats is also built-in to the compiler. it doesn't look as though it can easily be extended, but i have waded through neither code nor spent time down by the docs. Plan 9's compilers use a pragma to allow sets of format types and flags to be defined outside the compiler, in a way that doesn't give other compilers heartburn, and thus without absolutely requiring ifdefs. to be fair, the current implementation assumes all flags (in the current scope) have the same meaning, and does define a handful of built-in flags such as '.' (although neither restriction is essential); 375 lines.