Adopt __printflike macro for -Wformat-nonliteral

This commit is contained in:
Guoye Zhang 2021-10-27 11:04:10 -07:00
parent 845a20b582
commit bd79297709
2 changed files with 5 additions and 0 deletions

View File

@ -35,6 +35,10 @@
#include <nghttp2/nghttp2.h> #include <nghttp2/nghttp2.h>
#include "nghttp2_mem.h" #include "nghttp2_mem.h"
#ifndef __printflike
# define __printflike(fmtarg, firstvararg)
#endif
#define nghttp2_min(A, B) ((A) < (B) ? (A) : (B)) #define nghttp2_min(A, B) ((A) < (B) ? (A) : (B))
#define nghttp2_max(A, B) ((A) > (B) ? (A) : (B)) #define nghttp2_max(A, B) ((A) > (B) ? (A) : (B))

View File

@ -147,6 +147,7 @@ static int check_ext_type_set(const uint8_t *ext_types, uint8_t type) {
return (ext_types[type / 8] & (1 << (type & 0x7))) > 0; return (ext_types[type / 8] & (1 << (type & 0x7))) > 0;
} }
__printflike(3, 4)
static int session_call_error_callback(nghttp2_session *session, static int session_call_error_callback(nghttp2_session *session,
int lib_error_code, const char *fmt, int lib_error_code, const char *fmt,
...) { ...) {