Skip to content

Commit 418779c

Browse files
firewaveglankk
andcommitted
mitigated some compiler warnings
Co-authored-by: glankk <glankk@users.noreply.github.com>
1 parent a9debe9 commit 418779c

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "GNU")
3737
add_compile_options(-Woverloaded-virtual) # when a function declaration hides virtual functions from a base class
3838

3939
add_compile_options(-Wsuggest-attribute=noreturn)
40-
add_compile_options_safe(-Wuseless-cast)
40+
#add_compile_options_safe(-Wuseless-cast) # triggered by _WIN32 code
4141
elseif (CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
4242
add_compile_definitions(_CRT_SECURE_NO_WARNINGS)
4343
# TODO: bump warning level
@@ -62,13 +62,17 @@ elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
6262
add_compile_options(-Wno-suggest-destructor-override)
6363
# contradicts -Wcovered-switch-default
6464
add_compile_options(-Wno-switch-default)
65+
# for _WIN32
66+
add_compile_options(-Wno-reserved-macro-identifier)
67+
add_compile_options(-Wno-unused-macros)
6568
# TODO: fix these?
6669
add_compile_options(-Wno-padded)
6770
add_compile_options(-Wno-sign-conversion)
6871
add_compile_options(-Wno-implicit-int-conversion)
6972
add_compile_options(-Wno-shorten-64-to-32)
7073
add_compile_options(-Wno-shadow-field-in-constructor)
7174

75+
7276
if (CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 14 OR CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 14)
7377
# TODO: verify this regression still exists in clang-15
7478
if (CMAKE_BUILD_TYPE STREQUAL "Release" OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")

simplecpp.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3113,7 +3113,7 @@ std::pair<simplecpp::FileData *, bool> simplecpp::FileDataCache::get(const std::
31133113
bool simplecpp::FileDataCache::getFileId(const std::string &path, FileID &id)
31143114
{
31153115
#ifdef _WIN32
3116-
HANDLE hFile = CreateFileA(path.c_str(), 0, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
3116+
HANDLE hFile = CreateFileA(path.c_str(), 0, FILE_SHARE_READ | FILE_SHARE_WRITE, nullptr, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, nullptr);
31173117

31183118
if (hFile == INVALID_HANDLE_VALUE)
31193119
return false;

0 commit comments

Comments
 (0)