]> git.ipfire.org Git - thirdparty/tor.git/commit
Add __attribute__(format)s for our varargs printf/scanf wrappers
authorNick Mathewson <nickm@torproject.org>
Wed, 30 May 2012 16:14:38 +0000 (12:14 -0400)
committerNick Mathewson <nickm@torproject.org>
Wed, 30 May 2012 16:14:38 +0000 (12:14 -0400)
commite28489467233bff4500a70f8a7b22e42ca3b3e68
treefccba02270c6a44fca8978d71d0f4bc8b548a4ee
parent75fc4dbbcabaedc715f0f9e883ccab1c9634e787
Add __attribute__(format)s for our varargs printf/scanf wrappers

It turns out that if you set the third argument of
__attribute__(format) to 0, GCC and Clang will check the format
argument without expecting to find variadic arguments.  This is the
correct behavior for vsnprintf, vasprintf, and vscanf.

I'm hoping this will fix bug 5969 (a clang warning) by telling clang that
the format argument to tor_vasprintf is indeed a format string.
changes/bug5969_022 [new file with mode: 0644]
src/common/compat.h
src/common/util.h