-
Notifications
You must be signed in to change notification settings - Fork 201
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Disable the MSVC C4232 warning #2449
Disable the MSVC C4232 warning #2449
Conversation
The way we use the addresses of the libyuv functions in src/reformat_libyuv.c, the addresses of those functions do not need to be "static", which I think means fixed from execution to execution. As long as the addresses of those functions are fixed during an execution, that is fine for src/reformat_libyuv.c. Fix AOMediaCodec#2447.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the MSVC warning C4232 documentation, the difficult part is what it means for the address of a function to be "static". I interpret it to mean the address of a function is fixed from execution to execution. Please see if you agree that is what "static" means in this context. Thanks!
INTERFACE /W4 # For clang-cl, /W4 enables -Wall and -Wextra | ||
/wd4232 # Disable: address of dllimport 'dllimport' is not static, | ||
# identity not guaranteed | ||
/wd4324 # Disable: structure was padded due to alignment specifier |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cmake-format reformatted lines 296-300 here. The only real change is the addition of lines 298-299.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
/wd4324 # Disable: structure was padded due to alignment specifier | ||
avif_enable_warnings | ||
INTERFACE /W4 # For clang-cl, /W4 enables -Wall and -Wextra | ||
/wd4232 # Disable: address of dllimport 'dllimport' is not static, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Though unlikely it sounds like this would be an error if /Za
was used. Though I guess the alternative would be to manually load the functions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or have a wrapper as you suggested with the totw reference in the bug.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for taking a look at the MSVC C4232 warning documentation. The wrapper would also fix the CFI issue, so it seems like the best long-term solution.
The way we use the addresses of the libyuv functions in src/reformat_libyuv.c, the addresses of those functions do not need to be "static", which I think means fixed from execution to execution. As long as the addresses of those functions are fixed during an execution, that is fine for src/reformat_libyuv.c.
Fix #2447.