Let’s make compiler to check return value in cpp functions. If there is wrong data type for interface’s return value, compiling process will fail and gives us error information.

  message(STATUS "===== configure compiling option =====, CMAKE_GENERATOR: ${CMAKE_GENERATOR}")
  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Werror=return-type")

  if(CMAKE_GENERATOR MATCHES "Ninja")
      set(CMAKE_NINJA_FORCE_RESPONSE_FILE OFF)
  endif()

We can also check uninitialized variables in C++ file by the setting:

-Werror=uninitialized

Categories: CMake

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments

Tex To PDF
: convert the Latex file which suffix is tex to a PDF file

X
0
Would love your thoughts, please comment.x
()
x