The GCC compiler (and possibly some other compiler) supports the attribute __attribute__ ((format (printf, string_idx, first_to_check))) which let the compiler check that the arguments to a printf-like function has an argument list that fits the format string. This is very handy and would be a desirable feature for the fail_if(), fail_unless() and similar functions.
Logged In: YES
user_id=2057756
Originator: YES
I have a works-for-me solution. Actually it works a LOT better for me. I'm aware that it may not work in all environments. I use Debian Linux and GCC 4.1.2. I have made a patch (attached) that is to be applied to check.c and check.h.in rev 433. If it is to be used it will probably need to be conditionally compiled only for the compilers/precompilers/environments that support it. However, in those environments I think it could be very useful. /A
File Added: check.c
Logged In: YES
user_id=2057756
Originator: YES
File Added: check.diff
Logged In: YES
user_id=2057756
Originator: YES
The attached file with the patch should be check.diff not check.c. /A
This is a duplicate of bug #107.