1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-08-08 17:42:09 +03:00

Replace Werror removal with pragma

Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
This commit is contained in:
Ben Taylor
2025-07-14 09:46:18 +01:00
parent bf650eeb88
commit 04b03d7712
5 changed files with 14 additions and 0 deletions

View File

@@ -271,6 +271,9 @@ function(set_gnu_base_compile_options target)
target_compile_options(${target} PRIVATE $<$<CONFIG:Check>:-Os>) target_compile_options(${target} PRIVATE $<$<CONFIG:Check>:-Os>)
target_compile_options(${target} PRIVATE $<$<CONFIG:CheckFull>:-Os -Wcast-qual>) target_compile_options(${target} PRIVATE $<$<CONFIG:CheckFull>:-Os -Wcast-qual>)
if(MBEDTLS_FATAL_WARNINGS)
target_compile_options(${target} PRIVATE -Werror)
endif(MBEDTLS_FATAL_WARNINGS)
endfunction(set_gnu_base_compile_options) endfunction(set_gnu_base_compile_options)
function(set_clang_base_compile_options target) function(set_clang_base_compile_options target)
@@ -293,6 +296,9 @@ function(set_clang_base_compile_options target)
set_target_properties(${target} PROPERTIES LINK_FLAGS_TSANDBG "-fsanitize=thread") set_target_properties(${target} PROPERTIES LINK_FLAGS_TSANDBG "-fsanitize=thread")
target_compile_options(${target} PRIVATE $<$<CONFIG:Check>:-Os>) target_compile_options(${target} PRIVATE $<$<CONFIG:Check>:-Os>)
if(MBEDTLS_FATAL_WARNINGS)
target_compile_options(${target} PRIVATE -Werror)
endif(MBEDTLS_FATAL_WARNINGS)
endfunction(set_clang_base_compile_options) endfunction(set_clang_base_compile_options)
function(set_iar_base_compile_options target) function(set_iar_base_compile_options target)
@@ -300,6 +306,9 @@ function(set_iar_base_compile_options target)
target_compile_options(${target} PRIVATE $<$<CONFIG:Release>:-Ohz>) target_compile_options(${target} PRIVATE $<$<CONFIG:Release>:-Ohz>)
target_compile_options(${target} PRIVATE $<$<CONFIG:Debug>:--debug -On>) target_compile_options(${target} PRIVATE $<$<CONFIG:Debug>:--debug -On>)
if(MBEDTLS_FATAL_WARNINGS)
target_compile_options(${target} PRIVATE --warnings_are_errors)
endif(MBEDTLS_FATAL_WARNINGS)
endfunction(set_iar_base_compile_options) endfunction(set_iar_base_compile_options)
function(set_msvc_base_compile_options target) function(set_msvc_base_compile_options target)

View File

@@ -19,6 +19,7 @@
#include "psa_util_internal.h" #include "psa_util_internal.h"
#include "psa/crypto.h" #include "psa/crypto.h"
#pragma GCC diagnostic warning "-Wenum-conversion"
#if defined(MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED) #if defined(MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED)
/* Define a local translating function to save code size by not using too many /* Define a local translating function to save code size by not using too many
* arguments in each translating place. */ * arguments in each translating place. */

View File

@@ -25,6 +25,7 @@
#include "psa/crypto.h" #include "psa/crypto.h"
#include "psa_util_internal.h" #include "psa_util_internal.h"
#pragma GCC diagnostic warning "-Wenum-conversion"
#if defined(MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_SOME_EPHEMERAL_ENABLED) #if defined(MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_SOME_EPHEMERAL_ENABLED)
/* Define a local translating function to save code size by not using too many /* Define a local translating function to save code size by not using too many

View File

@@ -17,6 +17,8 @@
* [SIRO] https://cabforum.org/wp-content/uploads/Chunghwatelecom201503cabforumV4.pdf * [SIRO] https://cabforum.org/wp-content/uploads/Chunghwatelecom201503cabforumV4.pdf
*/ */
#pragma GCC diagnostic warning "-Wenum-conversion"
#include "x509_internal.h" #include "x509_internal.h"
#if defined(MBEDTLS_X509_CRT_PARSE_C) #if defined(MBEDTLS_X509_CRT_PARSE_C)

View File

@@ -14,6 +14,7 @@
#include <mbedtls/private/pk_private.h> #include <mbedtls/private/pk_private.h>
#endif /* MBEDTLS_PK_HAVE_PRIVATE_HEADER */ #endif /* MBEDTLS_PK_HAVE_PRIVATE_HEADER */
#include "mbedtls/psa_util.h" #include "mbedtls/psa_util.h"
#pragma GCC diagnostic warning "-Wenum-conversion"
#if defined(MBEDTLS_USE_PSA_CRYPTO) && \ #if defined(MBEDTLS_USE_PSA_CRYPTO) && \
defined(MBEDTLS_PEM_WRITE_C) && defined(MBEDTLS_X509_CSR_WRITE_C) defined(MBEDTLS_PEM_WRITE_C) && defined(MBEDTLS_X509_CSR_WRITE_C)