Re: Use -Wformat for own functions?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"Bo Do" <bodo@xxxxxxxx> writes:

> 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.

Yes. Check __attribute__((printf)).

-- 
	Falk

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux