Fix error: unused variable 'result'#184
Closed
felixf4xu wants to merge 1 commit intofoonathan:mainfrom
Closed
Conversation
Signed-off-by: U-CW01\uig08771 <uig08771@HIL4255W.cw01.contiwan.com>
Contributor
|
The same problem also exists in another place, as shown below: void foonathan::memory::virtual_memory_decommit(void* memory, std::size_t no_pages) noexcept
{
auto result = VirtualFree(memory, no_pages * virtual_memory_page_size, MEM_DECOMMIT);
FOONATHAN_MEMORY_ASSERT_MSG(result, "cannot decommit memory");
}I fix on pull-189. |
foonathan
pushed a commit
that referenced
this pull request
May 2, 2025
Owner
|
Thanks for the PR, I went with the approach from #189. And sorry for the delay. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi,
When I build this project (with gcc 14) for this code:
memory/src/virtual_memory.cpp
Lines 48 to 52 in 016c9fb
I had this error:
it happens when
FOONATHAN_MEMORY_DEBUG_ASSERTis not defined and thenFOONATHAN_MEMORY_ASSERT_MSGis an empty macro and thenresultis not used.This PR is to fix the compiling error.
Fix #183