mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-07-28 00:21:48 +03:00
Warn if mbedtls_config.h is included manually
Some projects using Mbed TLS have migrated their configuration file (config.h -> mbedtls_config.h, or MBEDTLS_CONFIG_FILE) from Mbed TLS 2.x, and kept including check_config.h. This is unnecessary since Mbed TLS 3.0, and increasingly in 3.x it may report spurious errors because the configuration adjustments have not been done yet. Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
This commit is contained in:
@ -19,6 +19,13 @@
|
|||||||
#define MBEDTLS_CHECK_CONFIG_H
|
#define MBEDTLS_CHECK_CONFIG_H
|
||||||
|
|
||||||
/* *INDENT-OFF* */
|
/* *INDENT-OFF* */
|
||||||
|
|
||||||
|
#if !defined(MBEDTLS_CONFIG_IS_FINALIZED)
|
||||||
|
#warning "Do not include mbedtls/check_config.h manually! " \
|
||||||
|
"This may cause spurious errors. " \
|
||||||
|
"It is included automatically at the right point since Mbed TLS 3.0."
|
||||||
|
#endif /* !MBEDTLS_CONFIG_IS_FINALIZED */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* We assume CHAR_BIT is 8 in many places. In practice, this is true on our
|
* We assume CHAR_BIT is 8 in many places. In practice, this is true on our
|
||||||
* target platforms, so not an issue, but let's just be extra sure.
|
* target platforms, so not an issue, but let's just be extra sure.
|
||||||
|
Reference in New Issue
Block a user