aboutsummaryrefslogtreecommitdiffstats
path: root/include/openssl
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2017-03-28 16:57:41 +0200
committerRichard Levitte <levitte@openssl.org>2017-03-29 16:16:25 +0200
commit1e53a9fd1ad1260274065c12d0e9efbabb7d94e1 (patch)
tree12c644de597b66cf7543eb78a38fa2c9882ed4fb /include/openssl
parent6edc71456463f66008b9cf40dadf00aba037f8da (diff)
downloadopenssl-1e53a9fd1ad1260274065c12d0e9efbabb7d94e1.tar.gz
Add z modifier parsing to the BIO_printf et all format string
Reviewed-by: Andy Polyakov <appro@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3064)
Diffstat (limited to 'include/openssl')
-rw-r--r--include/openssl/bio.h14
1 files changed, 10 insertions, 4 deletions
diff --git a/include/openssl/bio.h b/include/openssl/bio.h
index 0cf095e1f9..6585ec03b4 100644
--- a/include/openssl/bio.h
+++ b/include/openssl/bio.h
@@ -724,10 +724,16 @@ void BIO_copy_next_retry(BIO *b);
* long BIO_ghbn_ctrl(int cmd,int iarg,char *parg);
*/
-# ifdef __GNUC__
-# define __bio_h__attr__ __attribute__
-# else
-# define __bio_h__attr__(x)
+# define __bio_h__attr__(x)
+# if defined(__GNUC__) && defined(__STDC_VERSION__)
+ /*
+ * Because we support the 'z' modifier, which made its appearance in C99,
+ * we can't use __attribute__ with pre C99 dialects.
+ */
+# if __STDC_VERSION__ >= 199901L
+# undef __bio_h__attr__
+# define __bio_h__attr__ __attribute__
+# endif
# endif
int BIO_printf(BIO *bio, const char *format, ...)
__bio_h__attr__((__format__(__printf__, 2, 3)));