-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Backport 2.7: Change file scoping of test helper functions #2320
Backport 2.7: Change file scoping of test helper functions #2320
Conversation
Dependent on configured options, not all of the helper functions were being used, which was leading to warning of unused functions with Clang. To avoid any complex compile time options, or adding more logic to generate_test_code.py to screen out unused functions, those functions which were provoking the warning were changed to remove static, remove them from file scope, and expose them to the linker.
tests/Makefile had some unused warnings disabled unnecessarily, which test-ref-configs.pl was turning back on. We don't need to disable these warnings so I'm turning them back on.
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.
This is a faithful backport of #2053
I've reflected the fix to the ChangeLog I made in #2053. @Patater / @mpg / @gilles-peskine-arm - Can at least two of you please re-review? Thanks. |
@@ -3,7 +3,7 @@ | |||
# To compile with PKCS11: add "-lpkcs11-helper" to LDFLAGS | |||
|
|||
CFLAGS ?= -O2 | |||
WARNING_CFLAGS ?= -Wall -W -Wdeclaration-after-statement -Wno-unused-function -Wno-unused-value | |||
WARNING_CFLAGS ?= -Wall -W -Wdeclaration-after-statement -Wunused |
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.
Minor: Probably don't need -Wunused
here, since -Wall
enables lots of -Wunused-*
warnings.
Note: the only failure in Jenkins on the PR head is the know-flaky timing test suite (on BSD) which hadn't been fixed yet when this PR was created. The job didn't run on the merge result due to the conflict in the ChangeLog. |
Description
This is a backport of #2053.
Dependent on configured options, not all of the helper functions were being used, which was leading to warning of unused functions with Clang.
To avoid any complex compile time options, or adding more logic to
generate_test_code.py
to screen out unused functions, those functions which were provoking the warning were changed to remove static, remove them from file scope, and expose them to the linker.Fixes #2051.
Status
READY
Todos