Merge pull request #2845 from mcharleb/cmake-posix-resurection

Remove policy that broke posix and fix gcc warning
This commit is contained in:
Lorenz Meier 2015-09-12 21:36:22 +02:00
commit d7e69baf80
1 changed files with 5 additions and 2 deletions

View File

@ -498,7 +498,6 @@ function(px4_add_common_flags)
-Werror=reorder
-Werror=uninitialized
-Werror=init-self
-Wno-unused-const-variable
#-Wcast-qual - generates spurious noreturn attribute warnings,
# try again later
#-Wconversion - would be nice, but too many "risky-but-safe"
@ -507,7 +506,11 @@ function(px4_add_common_flags)
# but generates too many false positives
)
if (NOT ${CMAKE_C_COMPILER_ID} STREQUAL "Clang")
if (${CMAKE_C_COMPILER_ID} STREQUAL "Clang")
list(APPEND warnings
-Wno-unused-const-variable
)
else(${CMAKE_C_COMPILER_ID} STREQUAL "Clang")
list(APPEND warnings
-Werror=unused-but-set-variable
-Wformat=1