From 2f3c7cae61aa618f94b6078c2e66372d1a12f82e Mon Sep 17 00:00:00 2001 From: Michael Zillgith Date: Sat, 12 Nov 2022 07:22:33 +0000 Subject: [PATCH] - added -Wundef compiler flag and removed some of the resulting warnings --- CMakeLists.txt | 5 +++++ src/iec61850/client/client_control.c | 2 +- src/mms/iso_mms/asn1c/asn_internal.h | 2 ++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 618916e9..6172e302 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -144,6 +144,11 @@ if (SUPPORT_REDUNDANT_DECLS) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wredundant-decls") endif(SUPPORT_REDUNDANT_DECLS) +check_c_compiler_flag("-Wundef" SUPPORT_UNDEF) +if (SUPPORT_UNDEF) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wundef") +endif(SUPPORT_UNDEF) + # write the detected stuff to this file configure_file( ${CMAKE_CURRENT_LIST_DIR}/config/stack_config.h.cmake diff --git a/src/iec61850/client/client_control.c b/src/iec61850/client/client_control.c index caa07148..ee9ec9e9 100644 --- a/src/iec61850/client/client_control.c +++ b/src/iec61850/client/client_control.c @@ -29,7 +29,7 @@ #include "mms_client_connection.h" #include "ied_connection_private.h" -#if _MSC_VER +#ifdef _MSC_VER #define snprintf _snprintf #endif diff --git a/src/mms/iso_mms/asn1c/asn_internal.h b/src/mms/iso_mms/asn1c/asn_internal.h index 493b4336..5d6910d8 100644 --- a/src/mms/iso_mms/asn1c/asn_internal.h +++ b/src/mms/iso_mms/asn1c/asn_internal.h @@ -11,6 +11,8 @@ #include "asn_application.h" /* Application-visible API */ +#define EMIT_ASN_DEBUG 0 + #include "lib_memory.h" #ifndef __NO_ASSERT_H__ /* Include assert.h only for internal use. */