Spell __attribute__((format(printf, ...))) with more underscores.

They may be spelled with or without underscores. Alas, a lot of C code (adb,
cURL) seems to find it a popular pasttime to #define printf *before* including
external headers. This is completely nonsense and invalid, but working around
it is easy and is what we (and OpenSSL) were doing before
061332f216.

I'll be sending a patch to cURL tomorrow to make them at least do their macro
trickery after external #includes for sanity. adb's sysdeps.h is a lot longer
and consistently #included first so I'll probably leave that be for lack of
time.

Change-Id: I03a0a253f2c902eb45f45faace1e5c5df4335ebf
Reviewed-on: https://boringssl-review.googlesource.com/7605
Reviewed-by: Steven Valdez <svaldez@google.com>
Reviewed-by: David Benjamin <davidben@google.com>
This commit is contained in:
David Benjamin 2016-03-30 00:42:17 -04:00
parent aa0bea7bc1
commit 4b7b048417

View File

@ -142,7 +142,7 @@ extern "C" {
#if defined(__GNUC__) #if defined(__GNUC__)
#define OPENSSL_PRINTF_FORMAT_FUNC(string_index, first_to_check) \ #define OPENSSL_PRINTF_FORMAT_FUNC(string_index, first_to_check) \
__attribute__((format(printf, string_index, first_to_check))) __attribute__((__format__(__printf__, string_index, first_to_check)))
#else #else
#define OPENSSL_PRINTF_FORMAT_FUNC(string_index, first_to_check) #define OPENSSL_PRINTF_FORMAT_FUNC(string_index, first_to_check)
#endif #endif