From cb37a0482f2db466e397a1924f81f67111ed5f45 Mon Sep 17 00:00:00 2001 From: Joseph Hickey Date: Tue, 1 Oct 2024 16:31:29 -0400 Subject: [PATCH] EDS: fixups to compiler config to avoid false warnings --- cmake/sample_defs/arch_build_custom.cmake | 22 ++++++++++++-------- cmake/sample_defs/mission_build_custom.cmake | 2 ++ cmake/sample_defs/native_osconfig.cmake | 16 ++++++++++++++ 3 files changed, 31 insertions(+), 9 deletions(-) diff --git a/cmake/sample_defs/arch_build_custom.cmake b/cmake/sample_defs/arch_build_custom.cmake index 194ec5b80..23613568c 100644 --- a/cmake/sample_defs/arch_build_custom.cmake +++ b/cmake/sample_defs/arch_build_custom.cmake @@ -26,14 +26,18 @@ # and uses the same warning options that are applied at the mission level. # add_compile_options( - -std=c99 # Target the C99 standard (without gcc extensions) - -pedantic # Issue all the warnings demanded by strict ISO C - -Wall # Warn about most questionable operations - -Wstrict-prototypes # Warn about missing prototypes - -Wwrite-strings # Warn if not treating string literals as "const" - -Wpointer-arith # Warn about suspicious pointer operations - -Werror # Treat warnings as errors (code should be clean) - -Wno-format-truncation # Inhibit printf-style format truncation warnings - -Wno-stringop-truncation # Inhibit string operation truncation warnings + -std=c99 # Target the C99 standard (without gcc extensions) + -pedantic # Issue all the warnings demanded by strict ISO C + -fstrict-aliasing + -Wall # Warn about most questionable operations + -Wstrict-prototypes # Warn about missing prototypes + -Wstrict-aliasing # Warn about strict aliasing violations + -Wwrite-strings # Warn if not treating string literals as "const" + -Wpointer-arith # Warn about suspicious pointer operations + -Wcast-align # Warn about casts that increase alignment requirements + -Werror # Treat warnings as errors (code should be clean) + -Wno-conversion # Lots of false positives + -Wno-stringop-truncation # Lots of false positives + -Wno-format-truncation # Lots of false positives ) diff --git a/cmake/sample_defs/mission_build_custom.cmake b/cmake/sample_defs/mission_build_custom.cmake index 01e940e60..61ff40c5e 100644 --- a/cmake/sample_defs/mission_build_custom.cmake +++ b/cmake/sample_defs/mission_build_custom.cmake @@ -19,6 +19,8 @@ add_compile_options( -Wpointer-arith # Warn about suspicious pointer operations -Wcast-align # Warn about casts that increase alignment requirements -Werror # Treat warnings as errors (code should be clean) + -Wno-format-truncation # Many false positives/non-issues + -Wno-stringop-truncation # Many false positives/non-issues ) # The _XOPEN_SOURCE directive is required for glibc to enable conformance with the diff --git a/cmake/sample_defs/native_osconfig.cmake b/cmake/sample_defs/native_osconfig.cmake index 9cc252707..c4f213f16 100644 --- a/cmake/sample_defs/native_osconfig.cmake +++ b/cmake/sample_defs/native_osconfig.cmake @@ -56,3 +56,19 @@ set(OSAL_CONFIG_DEBUG_PERMISSIVE_MODE TRUE) # However for a flight deployment this may cause undesired delays. # set(OSAL_CONFIG_UTILITYTASK_PRIORITY 10) + +# +# OSAL_CONFIG_INCLUDE_SHELL +# -------------------------------- +# +# Enable the shell functions in OSAL +set(OSAL_CONFIG_INCLUDE_SHELL TRUE) + +# +# OSAL_CONFIG_PRINTF_BUFFER_SIZE +# -------------------------------- +# +# Increase the OS_printf buffer size +set(OSAL_CONFIG_PRINTF_BUFFER_SIZE 300) + +