Skip to content
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

Avoid -Wunused-function on macOS for some Float16 intrinsics #43174

Merged
merged 1 commit into from
Nov 20, 2021

Conversation

ararslan
Copy link
Member

We're defining half_to_float and float_to_half unconditionally but only ever calling them on non-Mac platforms, so Clang produces unused function warnings during the build on macOS. To fix this, we can just move the platform check to encompass the definitions in addition to the uses.

These functions were added in #37510. Do let me know if having these outside of the platform check was intentional and/or would have adverse downstream effects. If not, this should be safe (but far from critical) to backport to 1.6 and 1.7.

We're defining `half_to_float` and `float_to_half` unconditionally but
only ever calling them on non-Mac platforms, so Clang produces unused
function warnings during the build on macOS. To fix this, we can just
move the platform check to encompass the definitions in addition to the
uses.
@ararslan ararslan requested review from vchuravy and maleadt November 20, 2021 19:27
@vtjnash vtjnash added the merge me PR is reviewed. Merge when all tests are passing label Nov 20, 2021
@DilumAluthge DilumAluthge merged commit 06d5308 into master Nov 20, 2021
@DilumAluthge DilumAluthge deleted the aa/macos-warning branch November 20, 2021 21:34
@DilumAluthge DilumAluthge removed the merge me PR is reviewed. Merge when all tests are passing label Nov 20, 2021
LilithHafner pushed a commit to LilithHafner/julia that referenced this pull request Feb 22, 2022
…iaLang#43174)

We're defining `half_to_float` and `float_to_half` unconditionally but
only ever calling them on non-Mac platforms, so Clang produces unused
function warnings during the build on macOS. To fix this, we can just
move the platform check to encompass the definitions in addition to the
uses.
LilithHafner pushed a commit to LilithHafner/julia that referenced this pull request Mar 8, 2022
…iaLang#43174)

We're defining `half_to_float` and `float_to_half` unconditionally but
only ever calling them on non-Mac platforms, so Clang produces unused
function warnings during the build on macOS. To fix this, we can just
move the platform check to encompass the definitions in addition to the
uses.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants