set compiler standard to ISO C90/ANSI C89 (#577)

SonarCloud is outputting some code smells for things that aren't possible for C89. Hopefully setting the code standard to C89/C90 properly will fix those bogus warnings.

Fix By: Brad House (@bradh352)
pull/580/head
Brad House 1 year ago committed by GitHub
parent eeec2252b5
commit cb0be5688e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      src/lib/CMakeLists.txt
  2. 6
      src/tools/CMakeLists.txt

@ -34,6 +34,7 @@ IF (CARES_SHARED)
COMPILE_PDB_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
SOVERSION ${CARES_LIB_VERSION_MAJOR}
VERSION "${CARES_LIB_VERSION_MAJOR}.${CARES_LIB_VERSION_MINOR}.${CARES_LIB_VERSION_RELEASE}"
C_STANDARD 90
)
TARGET_INCLUDE_DIRECTORIES (${PROJECT_NAME}
@ -78,6 +79,7 @@ IF (CARES_STATIC)
OUTPUT_NAME cares${STATIC_SUFFIX}
COMPILE_PDB_NAME cares${STATIC_SUFFIX}
COMPILE_PDB_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
C_STANDARD 90
)
IF (CARES_STATIC_PIC)

@ -15,6 +15,9 @@ IF (CARES_BUILD_TOOLS)
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>"
PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}"
)
SET_TARGET_PROPERTIES (ahost PROPERTIES
C_STANDARD 90
)
TARGET_COMPILE_DEFINITIONS (ahost PRIVATE HAVE_CONFIG_H=1)
TARGET_LINK_LIBRARIES (ahost PRIVATE ${PROJECT_NAME})
IF (CARES_INSTALL)
@ -32,6 +35,9 @@ IF (CARES_BUILD_TOOLS)
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>"
PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}"
)
SET_TARGET_PROPERTIES (adig PROPERTIES
C_STANDARD 90
)
TARGET_COMPILE_DEFINITIONS (adig PRIVATE HAVE_CONFIG_H=1)
TARGET_LINK_LIBRARIES (adig PRIVATE ${PROJECT_NAME})
IF (CARES_INSTALL)

Loading…
Cancel
Save