-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Temporarily add pragmas #10271
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
base: development
Are you sure you want to change the base?
Temporarily add pragmas #10271
Conversation
b34a28f
to
4963a78
Compare
fa7a36e
to
b24487c
Compare
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.
As discussed in Slack, this is not acceptable. It'll hide errors for everyone until we undo it.
I don't know what the problem is precisely. It would be ok to disable a specific error locally with a #pragma GCC diagnostic
(grep for examples where we know that some warning is spurious). Or maybe we should do the transition differently.
CMakeLists.txt
Outdated
@@ -271,9 +271,6 @@ function(set_gnu_base_compile_options target) | |||
target_compile_options(${target} PRIVATE $<$<CONFIG:Check>:-Os>) | |||
target_compile_options(${target} PRIVATE $<$<CONFIG:CheckFull>:-Os -Wcast-qual>) | |||
|
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.
How about the following transition, would this work?
- In crypto, make
mbedtls_pk_sigalg_t
an alias ofmbedtls_pk_type_t
. - In mbedtls, replace
mbedtls_pk_type_t
bymbedtls_pk_sigalg_t
(so we'd be doing most of Switch to mbedtls_pk_sigalg_t #10264 before Create new enum mbedtls_pk_sigalg_t TF-PSA-Crypto#356). - In crypto, change
mbedtls_pk_sigalg_t
to be the desired type. - In mbedtls, finish Switch to mbedtls_pk_sigalg_t #10264.
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.
I've updated the chain to use pragma's, which I think is the easiest way to get the changes in. Let me know what you think though?
db651aa
to
6ca4ce4
Compare
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.
The #pragma
change is OK to me, but putting it on top of a C file then it applies to it all. I know that this change is temporary and since there's no other change in this PR we should be fine, but I would prefer to limit this "disabling" only on where it's strictly needed inside the C file. I think you can use:
#pragma GCC diagnostic push
#pragma GCC diagnostic warning "-Wenum-conversion"
....
#pragma GCC diagnostic pop
to store/resume checks around the problematic lines. Do you think this is feasible?
Signed-off-by: Ben Taylor <[email protected]>
Signed-off-by: Ben Taylor <[email protected]>
6ca4ce4
to
2c1b078
Compare
Signed-off-by: Ben Taylor <[email protected]>
The pragmas need to be protected from compilers that don't recognize them. I think it would be easier to write a single conversion function and use that, rather than put pragmas everywhere. |
Description
Temporarily add pragmas to allow switching of function prototypes contributes to Mbed-TLS/TF-PSA-Crypto#346.
This PR is part of a chain which needs to be merged in the following order:
PR checklist