printf() checking for custom functions

Randall Hopper viznut@charter.net
Tue Sep 25 23:21:00 GMT 2007


-Wformat causes printf() args to be checked based on the format:

   int printf(const char *format, ...);

How do ask gcc to apply this same checking to user-defined functions?

   int myDebug(const char *format, ...);

Apps often implement their own version of printf() for debugs, warnings,
etc. with output switchable between console, log files, both, etc.  It
would be very useful to have gcc perform similar sanity checks for their
arg lists.

Thanks,

Randall



More information about the Gcc-help mailing list