2021-02-11 05:09 AM
Hi all,
You have one small bug in your compiler.
When I create macro like that:
#define CONV_STR2DEC(str, i) (str[i]>'0'?str[i]-'0':0)
const uint32_t version = CONV_STR2DEC(__TIME__, 6);
IDE return info that "initializer element is not constant" what is not true.
Your version of gcc thinks this is an expression, but I think they should try to interpret it first.
When I use GCC from Linearo, this problem not exist.
Best regards
Adrian
2021-02-11 05:19 AM
I think it is highly unlikely that ST would modify a compiler provided by a third-party.
It is more likely that the difference arises because your code is being compiled to a different language (C vs C++) or a different version of the language e.g. C++11, C++14, C++17). Later versions were capable of doing more things at compile-time.
Hope this helps,
Danish