Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Some old compilers seem to emit bogus warnings on ci
authorAugustin Degomme <augustin.degomme@imag.fr>
Mon, 28 Jul 2014 17:02:23 +0000 (19:02 +0200)
committerAugustin Degomme <augustin.degomme@imag.fr>
Mon, 28 Jul 2014 17:02:23 +0000 (19:02 +0200)
See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=45978 .
Avoid failing the build in this case

buildtools/Cmake/Flags.cmake

index 0b36869..3c6c4ad 100644 (file)
@@ -17,6 +17,10 @@ if(enable_compile_warnings)
     if(COMPILER_C_VERSION_MAJOR_MINOR STRGREATER "4.5")
       set(warnCFLAGS "${warnCFLAGS}-Wno-error=unused-but-set-variable ")
     endif()
+    if(COMPILER_C_VERSION_MAJOR_MINOR STREQUAL "4.6")
+    #some old compilers emit bogus warnings here, see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=45978 . Avoid failing the build in this case
+      set(warnCFLAGS "${warnCFLAGS}-Wno-error=array-bounds")
+    endif()
   endif()
 
   set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra  -Wunused -Wpointer-arith -Wchar-subscripts -Wcomment -Wno-unknown-warning-option -Wformat -Wwrite-strings -Wno-unused-function -Wno-unused-parameter -Wno-strict-aliasing -Wclobbered -Wno-error=clobbered -Wno-format-nonliteral -Werror")