From c57ef48852d1cb621c798a50e1dc40231df6e063 Mon Sep 17 00:00:00 2001 From: LIU Hao Date: Wed, 24 Jul 2024 23:03:34 +0800 Subject: [PATCH] build: Disable `-Wstringop-overflow` --- meson.build | 2 +- poseidon/http/http_request_parser.cpp | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/meson.build b/meson.build index 6ac7bd7a..a6676c4a 100644 --- a/meson.build +++ b/meson.build @@ -286,7 +286,7 @@ add_project_arguments( '-Wmissing-declarations', '-Wmissing-field-initializers', '-Wshadow', '-Wsuggest-attribute=noreturn', '-Wswitch-enum', '-Wunused-function', '-Wunused-label', '-Wunused-local-typedefs', '-Wunused-but-set-variable', - '-Wunused-but-set-parameter', + '-Wunused-but-set-parameter', '-Wno-stringop-overflow', language: [ 'c', 'cpp' ]) add_project_arguments( diff --git a/poseidon/http/http_request_parser.cpp b/poseidon/http/http_request_parser.cpp index 13d76f0d..95060ec5 100644 --- a/poseidon/http/http_request_parser.cpp +++ b/poseidon/http/http_request_parser.cpp @@ -56,11 +56,8 @@ HTTP_Request_Parser::s_settings[1] = +[](::http_parser* ps) { // Set the method string. This might not be null-terminated. -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wstringop-truncation" const char* method_str = ::http_method_str(static_cast<::http_method>(ps->method)); ::strncpy(this->m_headers.method_bytes, method_str, sizeof(this->m_headers.method_bytes)); -#pragma GCC diagnostic pop // Convert header values from strings to their presumed form. HTTP_Value value;