-
Notifications
You must be signed in to change notification settings - Fork 362
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
silence -Wunused-function on MacOS-arm64 #382
base: master
Are you sure you want to change the base?
Conversation
the #endif was in the wrong place, causing the error /Users/runner/work/php-src/php-src/ext/hash/blake3/upstream_blake3/c/blake3_dispatch.c:112:5: error: unused function 'get_cpu_features' [-Werror,-Wunused-function] full compiler log https://github.com/php/php-src/actions/runs/7762643678/job/21173438425?pr=13194
patches to specifically address a gcc -Werror=logical-op issue explained in BLAKE3-team/BLAKE3#380 and a gcc -Wunused-function issue explained in BLAKE3-team/BLAKE3#382 and optimized upstream git checkout to only fetch the files we want.
It looks like this move makes |
C23 has a solution: https://en.cppreference.com/w/c/language/attributes/maybe_unused Maybe make get_cpu_features() always static, and make a public non-static blake3_get_cpu_features() which is just a wrapper for get_cpu_features() ? that would get rid of the unused warning. if you go that route, maybe some more thought should be put into exactly what the public function should return tho, idk |
a possible alternative solution: #383 (it may solve the problem for ARM specifically, but probably not for other non-x86-non-arm architectures) |
Don't have to use this fix, but would be nice if /a/ fix could be added. At 1.5.5 it still causes headache for integration in project compiling for MacOS with -Wunused-function -Werror |
the #endif was in the wrong place, on MacOS-arm64 causing the error /Users/runner/work/php-src/php-src/ext/hash/blake3/upstream_blake3/c/blake3_dispatch.c:112:5: error: unused function 'get_cpu_features' [-Werror,-Wunused-function]
full compiler log showcasing the issue https://github.com/php/php-src/actions/runs/7762643678/job/21173438425?pr=13194