Browse Source

add missing message format

Alternative fix for build issue in debug mode with GCC.
Hansi P 1 year ago
parent
commit
eeddc01ac2
2 changed files with 2 additions and 10 deletions
  1. 0 8
      src/civetweb.c
  2. 2 2
      src/http2.inl

+ 0 - 8
src/civetweb.c

@@ -230,16 +230,8 @@ static void DEBUG_TRACE_FUNC(const char *func,
                              PRINTF_FORMAT_STRING(const char *fmt),
                              PRINTF_FORMAT_STRING(const char *fmt),
                              ...) PRINTF_ARGS(3, 4);
                              ...) PRINTF_ARGS(3, 4);
 
 
-#if defined(__cplusplus) && (__cplusplus >= 202002L)
-#define DEBUG_TRACE(fmt, ...)                                                  \
-	DEBUG_TRACE_FUNC(__func__, __LINE__, fmt __VA_OPT__(, ) __VA_ARGS__)
-#elif defined(__GNUC__) && defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L)
-#define DEBUG_TRACE(fmt, ...)                                                  \
-	DEBUG_TRACE_FUNC(__func__, __LINE__, fmt, ##__VA_ARGS__)
-#else
 #define DEBUG_TRACE(fmt, ...)                                                  \
 #define DEBUG_TRACE(fmt, ...)                                                  \
 	DEBUG_TRACE_FUNC(__func__, __LINE__, fmt, __VA_ARGS__)
 	DEBUG_TRACE_FUNC(__func__, __LINE__, fmt, __VA_ARGS__)
-#endif
 
 
 #define NEED_DEBUG_TRACE_FUNC
 #define NEED_DEBUG_TRACE_FUNC
 #if !defined(DEBUG_TRACE_STREAM)
 #if !defined(DEBUG_TRACE_STREAM)

+ 2 - 2
src/http2.inl

@@ -1442,7 +1442,7 @@ handle_http2(struct mg_connection *conn)
 					    hpack_decode(buf, &i, (int)bytes_read, conn->phys_ctx);
 					    hpack_decode(buf, &i, (int)bytes_read, conn->phys_ctx);
 					CHECK_LEAK_HDR_ALLOC(key);
 					CHECK_LEAK_HDR_ALLOC(key);
 					if (!key) {
 					if (!key) {
-						DEBUG_TRACE("HTTP2 key decoding error");
+						DEBUG_TRACE("%s", "HTTP2 key decoding error");
 						goto clean_http2;
 						goto clean_http2;
 					}
 					}
 				} else if (/*(idx >= 15) &&*/ (idx <= 61)) {
 				} else if (/*(idx >= 15) &&*/ (idx <= 61)) {
@@ -1509,7 +1509,7 @@ handle_http2(struct mg_connection *conn)
 					                   conn->phys_ctx); /* leak? */
 					                   conn->phys_ctx); /* leak? */
 					CHECK_LEAK_HDR_ALLOC(val);
 					CHECK_LEAK_HDR_ALLOC(val);
 					if (!val) {
 					if (!val) {
-						DEBUG_TRACE("HTTP2 value decoding error");
+						DEBUG_TRACE("%s", "HTTP2 value decoding error");
 						mg_free((void *)key);
 						mg_free((void *)key);
 						goto clean_http2;
 						goto clean_http2;
 					}
 					}