Use -Wformat for own functions?

Bo Do bodo@flygp.se
Wed Nov 12 11:02:00 GMT 2003


Hello all!

I've written my own version of sprintf:
my_sprintf(MyBuffer, const char *format, ...)
I wonder if there's a way to use -Wformat, or any functionality of the compiler, to make sure that the number of arguments supplied (the ... ) are correct and have types appropriate to the format string specified.
-Wformat has the functionality I want, but it only checks the printf and scanf functions in stdio.

Thanks for any hints or help.
/Bo



More information about the Gcc-help mailing list