From 4afd19f037dd08f9ea8a62f473c9bc4aae333a4d Mon Sep 17 00:00:00 2001 From: Eric Katzfey Date: Thu, 20 Oct 2022 11:11:36 -0700 Subject: [PATCH] Moved the bad-function-cast compiler warning option out of the common flags and into the nuttx and posix specific options files since this option cannot be used with the qurt platform. There are header files in the hexagon sdk that fail this check. --- cmake/px4_add_common_flags.cmake | 1 - platforms/nuttx/cmake/px4_impl_os.cmake | 2 ++ platforms/posix/cmake/px4_impl_os.cmake | 2 ++ 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/cmake/px4_add_common_flags.cmake b/cmake/px4_add_common_flags.cmake index bf83ceb0f0..b97d591c7b 100644 --- a/cmake/px4_add_common_flags.cmake +++ b/cmake/px4_add_common_flags.cmake @@ -144,7 +144,6 @@ function(px4_add_common_flags) list(APPEND c_flags -fno-common - -Wbad-function-cast -Wnested-externs -Wstrict-prototypes ) diff --git a/platforms/nuttx/cmake/px4_impl_os.cmake b/platforms/nuttx/cmake/px4_impl_os.cmake index d68b4becb7..87c24cabbf 100644 --- a/platforms/nuttx/cmake/px4_impl_os.cmake +++ b/platforms/nuttx/cmake/px4_impl_os.cmake @@ -69,6 +69,8 @@ function(px4_os_add_flags) add_compile_options($<$:-fno-sized-deallocation>) + add_compile_options($<$:-Wbad-function-cast>) + add_definitions( -D__PX4_NUTTX diff --git a/platforms/posix/cmake/px4_impl_os.cmake b/platforms/posix/cmake/px4_impl_os.cmake index b334336ab4..49c3813bda 100644 --- a/platforms/posix/cmake/px4_impl_os.cmake +++ b/platforms/posix/cmake/px4_impl_os.cmake @@ -238,6 +238,8 @@ function(px4_os_add_flags) endif() + add_compile_options($<$:-Wbad-function-cast>) + endfunction() #=============================================================================