Skip to content

Commit

Permalink
#113 fix msvc warning C6031: Return value ignored: '_fullpath'.
Browse files Browse the repository at this point in the history
  • Loading branch information
fdefelici committed Nov 10, 2024
1 parent f723e54 commit 9b1f741
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci_action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:
echo "== CMAKE VERSION =="
cmake --version
echo "== CMAKE CONFIGURE =="
cmake -B${{env.BUILD_DIR}} -DCLOVE_CMAKE__UC_BUILD=ON
cmake -B${{env.BUILD_DIR}} -DCLOVE_CMAKE__UC_BUILD=ON -DCLOVE_CMAKE__CPP_STRICT_WARN_AS_ERROR=ON
echo "== CMAKE BUILD =="
cmake --build ${{env.BUILD_DIR}} --config Release
- name: List Build
Expand Down
5 changes: 3 additions & 2 deletions clove-unit.h
Original file line number Diff line number Diff line change
Expand Up @@ -1001,8 +1001,9 @@ char* __clove_path_to_absolute(const char* rel_path) {
char* result = NULL;
#if _WIN32
result = __CLOVE_MEMORY_MALLOC_TYPE_N(char, _MAX_PATH);
//if( _fullpath( full, partialPath, _MAX_PATH ) != NULL )
_fullpath(result, rel_path, _MAX_PATH );

char* discarded = _fullpath(result, rel_path, _MAX_PATH );
__CLOVE_UNUSED_VAR(discarded); //fix "warning C6031: Return value ignored: '_fullpath'."
#else
result = __CLOVE_MEMORY_MALLOC_TYPE_N(char, PATH_MAX);
if (__clove_path_exists(rel_path)) {
Expand Down
2 changes: 1 addition & 1 deletion tests/stricts/clove-c/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ set_property(TARGET StrictCloveC PROPERTY COMPILE_WARNING_AS_ERROR ON)

# Compiler Options
if (MSVC)
target_compile_options(StrictCloveC PRIVATE /W4)
target_compile_options(StrictCloveC PRIVATE /W4 /analyze)
else() # GCC and CLANG
target_compile_options(StrictCloveC PRIVATE -Wall -Wextra -Wpedantic)
endif()
2 changes: 1 addition & 1 deletion tests/stricts/clove-cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ endif()

# Compiler Options
if (MSVC)
target_compile_options(StrictCloveCpp PRIVATE /W4)
target_compile_options(StrictCloveCpp PRIVATE /W4 /analyze)
else() # GCC and CLANG
target_compile_options(StrictCloveCpp PRIVATE -Wall -Wextra -Wpedantic)
endif()

0 comments on commit 9b1f741

Please sign in to comment.