esp-idf use of std=gnu99
Posted: Tue Mar 03, 2020 8:56 am
Hello,
Is there any technical reason why esp-idf v4.0 and release/v4.1 are still using std=gnu99 over newer versions of the language (such as gnu11)? The following preprocessor-time error triggers on std=gnu99:
I am preparing a header file to be shared among various projects and microcontrollers which uses _Generic, so it requires C11 support. Surprisingly though, gnu99 supports _Generic even if __STDC_VERSION__ < 201112L, but that is not a safe assumption under other compilers. For the time being, I am skipping the C version check as long as CONFIG_IDF_TARGET_ESP32 or CONFIG_IDF_TARGET_ESP32S2BETA are defined, but that does not sound reasonable.
Is there any real reason not to migrate to std=gnu11?
Is there any technical reason why esp-idf v4.0 and release/v4.1 are still using std=gnu99 over newer versions of the language (such as gnu11)? The following preprocessor-time error triggers on std=gnu99:
Code: Select all
#define STR(x) #x
#define _STR(x) STR(x)
#if __STDC_VERSION__ >= 201112L
/* C11-compliant code here */
#else
#error C11 not supported
#pragma message "Supported C standard: " _STR(__STDC_VERSION__)
#endif
Code: Select all
#error C11 not supported
note: #pragma message: Supported C standard: 199901L
Is there any real reason not to migrate to std=gnu11?