-
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
Flexible array members are not standard C++ #9020
Labels
bug
component-crypto
Crypto primitives and low-level interfaces
size-s
Estimated task size: small (~2d)
Comments
gilles-peskine-arm
added
bug
component-crypto
Crypto primitives and low-level interfaces
size-s
Estimated task size: small (~2d)
labels
Apr 9, 2024
gilles-peskine-arm
added a commit
to gilles-peskine-arm/mbedtls
that referenced
this issue
Jun 6, 2024
The reason these functions are deprecated is that they cause strict C++ compilers to error out, since they use a struct type with a flexible array member and that is not standard C++. Resolves Mbed-TLS#9020. Signed-off-by: Gilles Peskine <[email protected]>
gilles-peskine-arm
added a commit
to gilles-peskine-arm/mbedtls
that referenced
this issue
Jun 6, 2024
Document psa_generate_key_ext() and psa_key_derivation_output_key_ext() as deprecated in favor of psa_generate_key_custom() and psa_key_derivation_output_key_custom(), and no longer declared in C++ builds. Resolves Mbed-TLS#9020. Signed-off-by: Gilles Peskine <[email protected]>
gilles-peskine-arm
added a commit
to gilles-peskine-arm/mbedtls
that referenced
this issue
Jun 6, 2024
In public headers, we want to avoid things that are not standard C++, including features that GCC and Clang support as extensions, such as flexible array members. So compile with `-pedantic`. Non-regression for Mbed-TLS#9020. Signed-off-by: Gilles Peskine <[email protected]>
6 tasks
gilles-peskine-arm
added a commit
to gilles-peskine-arm/mbedtls
that referenced
this issue
Jun 7, 2024
Document psa_generate_key_ext() and psa_key_derivation_output_key_ext() as deprecated in favor of psa_generate_key_custom() and psa_key_derivation_output_key_custom(), and no longer declared in C++ builds. Resolves Mbed-TLS#9020. Signed-off-by: Gilles Peskine <[email protected]>
gilles-peskine-arm
added a commit
to gilles-peskine-arm/mbedtls
that referenced
this issue
Jun 7, 2024
In public headers, we want to avoid things that are not standard C++, including features that GCC and Clang support as extensions, such as flexible array members. So compile with `-pedantic`. Non-regression for Mbed-TLS#9020. Signed-off-by: Gilles Peskine <[email protected]>
gilles-peskine-arm
added a commit
to gilles-peskine-arm/mbedtls
that referenced
this issue
Jul 31, 2024
Document psa_generate_key_ext() and psa_key_derivation_output_key_ext() as deprecated in favor of psa_generate_key_custom() and psa_key_derivation_output_key_custom(), and no longer declared in C++ builds. Resolves Mbed-TLS#9020. Signed-off-by: Gilles Peskine <[email protected]>
gilles-peskine-arm
added a commit
to gilles-peskine-arm/mbedtls
that referenced
this issue
Jul 31, 2024
In public headers, we want to avoid things that are not standard C++, including features that GCC and Clang support as extensions, such as flexible array members. So compile with `-pedantic`. Non-regression for Mbed-TLS#9020. Signed-off-by: Gilles Peskine <[email protected]>
gilles-peskine-arm
added a commit
to gilles-peskine-arm/mbedtls
that referenced
this issue
Aug 2, 2024
Document psa_generate_key_ext() and psa_key_derivation_output_key_ext() as deprecated in favor of psa_generate_key_custom() and psa_key_derivation_output_key_custom(), and no longer declared in C++ builds. Resolves Mbed-TLS#9020. Signed-off-by: Gilles Peskine <[email protected]>
gilles-peskine-arm
added a commit
to gilles-peskine-arm/mbedtls
that referenced
this issue
Aug 2, 2024
In public headers, we want to avoid things that are not standard C++, including features that GCC and Clang support as extensions, such as flexible array members. So compile with `-pedantic`. Non-regression for Mbed-TLS#9020. Signed-off-by: Gilles Peskine <[email protected]>
gilles-peskine-arm
added a commit
to gilles-peskine-arm/mbedtls
that referenced
this issue
Aug 5, 2024
Document psa_generate_key_ext() and psa_key_derivation_output_key_ext() as deprecated in favor of psa_generate_key_custom() and psa_key_derivation_output_key_custom(), and no longer declared in C++ builds. Resolves Mbed-TLS#9020. Signed-off-by: Gilles Peskine <[email protected]>
gilles-peskine-arm
added a commit
to gilles-peskine-arm/mbedtls
that referenced
this issue
Aug 5, 2024
In public headers, we want to avoid things that are not standard C++, including features that GCC and Clang support as extensions, such as flexible array members. So compile with `-pedantic`. Non-regression for Mbed-TLS#9020. Signed-off-by: Gilles Peskine <[email protected]>
gilles-peskine-arm
added a commit
to gilles-peskine-arm/mbedtls
that referenced
this issue
Aug 6, 2024
Document psa_generate_key_ext() and psa_key_derivation_output_key_ext() as deprecated in favor of psa_generate_key_custom() and psa_key_derivation_output_key_custom(), and no longer declared in C++ builds. Resolves Mbed-TLS#9020. Signed-off-by: Gilles Peskine <[email protected]>
gilles-peskine-arm
added a commit
to gilles-peskine-arm/mbedtls
that referenced
this issue
Aug 6, 2024
In public headers, we want to avoid things that are not standard C++, including features that GCC and Clang support as extensions, such as flexible array members. So compile with `-pedantic`. Non-regression for Mbed-TLS#9020. Signed-off-by: Gilles Peskine <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
bug
component-crypto
Crypto primitives and low-level interfaces
size-s
Estimated task size: small (~2d)
Since Mbed TLS 3.6.0, one of the types declared in an Mbed TLS header is a struct with a flexible array member:
typedef struct psa_key_production_parameters_s psa_key_production_parameters_t
.This is standard C99, but not standard C++ (any version), although many compilers accept it.
First reported here.
Importance:
-pedantic
; currently partly by design because of other non-strict-C++-compliance that we'd also like to fix).Goal of this issue: find a solution so that at least users who don't call
psa_generate_key_ext
, and so don't actually needstruct psa_key_production_parameters_s
, can compile their C++ application with a strict C++ compiler that doesn't support flexible array members. This must be done without an API change for users who are building with a C99 compiler.Validation:
g++ -std=c++17 -pedantic
andclang++ -std=c++17 -pedantic
, ideally on the CI, but at least manually if we haven't fixed #7087.The text was updated successfully, but these errors were encountered: