Fix new clang warning in library_wasm_worker.c. NFC#18936
Merged
Conversation
Clang recently started generating a warning if we assert that a paramater marked as `nonnull` is not null. The code in question is: assert(stackLowestAddress != 0); And the warning is: library_wasm_worker.c:32:9: warning: comparison of nonnull parameter 'stackLowestAddress' not equal to a null pointer is 'true' on first encounter [-Wtautological-pointer-compare]
Collaborator
Author
|
This unblocks the llvm roller. |
Member
|
Would it make more sense to just fix the code? I assume the compiler is just going to compile the check away to nothing anyway? |
dschuff
approved these changes
Mar 10, 2023
Member
dschuff
left a comment
There was a problem hiding this comment.
I guess we need to unblock the roller.
Collaborator
Author
Yeah my first thought was to remove the assert... but actually it seems like it still useful to have maybe? |
Member
|
You think it's better to disable the warning with a flag like this, or a pragma in the file? |
impact-maker
pushed a commit
to impact-maker/emscripten
that referenced
this pull request
Mar 17, 2023
…18936) Clang recently started generating a warning if we assert that a paramater marked as `nonnull` is not null. The code in question is: assert(stackLowestAddress != 0); And the warning is: library_wasm_worker.c:32:9: warning: comparison of nonnull parameter 'stackLowestAddress' not equal to a null pointer is 'true' on first encounter [-Wtautological-pointer-compare]
impact-maker
pushed a commit
to impact-maker/emscripten
that referenced
this pull request
Mar 17, 2023
…18936) Clang recently started generating a warning if we assert that a paramater marked as `nonnull` is not null. The code in question is: assert(stackLowestAddress != 0); And the warning is: library_wasm_worker.c:32:9: warning: comparison of nonnull parameter 'stackLowestAddress' not equal to a null pointer is 'true' on first encounter [-Wtautological-pointer-compare]
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.
Clang recently started generating a warning if we assert that a paramater marked as
nonnullis not null. The code in question is:assert(stackLowestAddress != 0);
And the warning is:
library_wasm_worker.c:32:9: warning: comparison of nonnull parameter 'stackLowestAddress' not equal to a null pointer is 'true' on first encounter [-Wtautological-pointer-compare]