We do not properly test C99 compatibility of our test code #697

Open
opened 2026-02-24 04:48:03 -06:00 by gilles-peskine-arm · 0 comments
gilles-peskine-arm commented 2026-02-24 04:48:03 -06:00 (Migrated from github.com)

We claim that TF-PSA-Crypto and Mbed TLS can be built with a C99 compiler. We test this by building with gcc -std=c99 or clang -std=c99. However, in CMake builds, we only do that for the library, not for the test code, because CMakeLists.txt calls

set_target_properties(tf_psa_crypto_test PROPERTIES C_STANDARD 11)
set_target_properties(test_suite_${data_name} PROPERTIES C_STANDARD 11)

So it may be impossible to build the unit tests with a C99 compiler, we wouldn't know. (Turns out we do have a few problems, though mostly due to glibc on Ubuntu 26.04, but not only: https://github.com/Mbed-TLS/TF-PSA-Crypto/issues/877 https://github.com/Mbed-TLS/TF-PSA-Crypto/issues/876 https://github.com/Mbed-TLS/TF-PSA-Crypto/issues/907.)

Things are probably ok in 3.6 because we do some testing with make CFLAGS='-std=c99 …' which builds everything with a C99 compiler.

We claim that TF-PSA-Crypto and Mbed TLS can be built with a C99 compiler. We test this by building with `gcc -std=c99` or `clang -std=c99`. However, in CMake builds, we only do that for the library, not for the test code, because `CMakeLists.txt` calls ``` set_target_properties(tf_psa_crypto_test PROPERTIES C_STANDARD 11) set_target_properties(test_suite_${data_name} PROPERTIES C_STANDARD 11) ``` So it may be impossible to build the unit tests with a C99 compiler, we wouldn't know. (Turns out we do have a few problems, though mostly due to glibc on Ubuntu 26.04, but not only: https://github.com/Mbed-TLS/TF-PSA-Crypto/issues/877 https://github.com/Mbed-TLS/TF-PSA-Crypto/issues/876 https://github.com/Mbed-TLS/TF-PSA-Crypto/issues/907.) Things are probably ok in 3.6 because we do some testing with `make CFLAGS='-std=c99 …'` which builds everything with a C99 compiler.
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
gh-Mbed-TLS/TF-PSA-Crypto#697
No description provided.