From 17c53c5c1e7fb48eee9e6db9da4bf2ffc8eea33b Mon Sep 17 00:00:00 2001 From: Andres Amaya Garcia Date: Thu, 24 Jan 2019 09:55:14 +0000 Subject: [PATCH] Fix check-generated-files.sh failure with query_config --- scripts/data_files/query_config.fmt | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/scripts/data_files/query_config.fmt b/scripts/data_files/query_config.fmt index 0e4659aae..064da4c38 100644 --- a/scripts/data_files/query_config.fmt +++ b/scripts/data_files/query_config.fmt @@ -115,8 +115,25 @@ #define MACRO_NAME_TO_STR(macro) \ mbedtls_printf( "%s", strlen( #macro "" ) > 0 ? #macro "\n" : "" ) +#if defined(_MSC_VER) +/* + * Visual Studio throws the warning 4003 because many Mbed TLS feature macros + * are defined empty. This means that from the preprocessor's point of view + * the macro MBEDTLS_EXPANSION_TO_STR is being invoked without arguments as + * some macros expand to nothing. We suppress that specific warning to get a + * clean build and to ensure that tests treating warnings as errors do not + * fail. + */ +#pragma warning(push) +#pragma warning(disable:4003) +#endif /* _MSC_VER */ + int query_config( const char *config ) { CHECK_CONFIG /* If the symbol is not found, return an error */ return( 1 ); } + +#if defined(_MSC_VER) +#pragma warning(pop) +#endif /* _MSC_VER */