Skip to content

Commit e505e75

Browse files
committed
Removing shadow warning because it is too sensitive for gcc but keeping for clang. Explicitly calling string conversion on the file path
1 parent a70fc65 commit e505e75

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

CMakeLists.txt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,14 +65,17 @@ endif()
6565

6666
list(APPEND GCC_CLANG_COMPILE_FLAGS
6767
-Wall -Wextra -Wpedantic
68-
-Wconversion -Wint-in-bool-context -Wshadow
68+
-Wconversion -Wint-in-bool-context
6969
-Wmissing-declarations -Wmissing-field-initializers
7070
-Werror
7171
)
7272

7373

74-
if (MSVC)
74+
if (CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
7575
add_compile_options(/W4 /WX)
76+
elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
77+
# Clang shadow warnings aren't as sensitive as gcc
78+
add_compile_options(${GCC_CLANG_COMPILE_FLAGS} -Wshadow)
7679
else()
7780
add_compile_options(${GCC_CLANG_COMPILE_FLAGS})
7881
endif()

test/common.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,5 @@ std::string create_temporary_dbc_with(const char* contents) {
4141
file << contents << std::endl;
4242
file.close();
4343

44-
return temp_file;
44+
return temp_file.string();
4545
}

0 commit comments

Comments
 (0)