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

Backport 2.7: Change file scoping of test helper functions #2320

Merged

Conversation

simonbutcher
Copy link
Contributor

@simonbutcher simonbutcher commented Dec 28, 2018

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

  • [ n/a ] Tests
  • [ n/a ] Documentation
  • Changelog updated
  • Backported

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.
@simonbutcher simonbutcher requested review from mpg, RonEld and Patater and removed request for RonEld December 28, 2018 12:03
@simonbutcher simonbutcher added bug mbed TLS team needs-review Every commit must be reviewed by at least two team members, component-platform Portability layer and build scripts labels Dec 28, 2018
mpg
mpg previously approved these changes Dec 31, 2018
Copy link
Contributor

@mpg mpg left a 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

@simonbutcher
Copy link
Contributor Author

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
Copy link
Contributor

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.

@mpg mpg removed the needs-review Every commit must be reviewed by at least two team members, label Apr 19, 2019
@mpg
Copy link
Contributor

mpg commented Apr 19, 2019

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.

@Patater Patater added the approved Design and code approved - may be waiting for CI or backports label Jun 18, 2019
@Patater Patater merged commit 57f2f69 into Mbed-TLS:mbedtls-2.7 Jun 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Design and code approved - may be waiting for CI or backports bug component-platform Portability layer and build scripts
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants