In the Arduino IDE, when teensy 2 is chosen, the struct initializer by name per the C99 standard does not work. It does work when the teensy 3 is chosen (different command line). Same issue in VM. Of course, different versions of GCC are used for Teensy 2 and Teensy 3. But the target core shouldn't matter to this issue on struct init by member name per C99.
I noted, in the GCC command line args, that Teensy 2 uses -std=c++0x whereas Teensy 3 uses -std=gnu++0x. I don't know if that's relevant.
Struct init by name in C99, example compiles OK with teensy 3 but not the GCC command line used by Teensy 2.
I noted, in the GCC command line args, that Teensy 2 uses -std=c++0x whereas Teensy 3 uses -std=gnu++0x. I don't know if that's relevant.
Struct init by name in C99, example compiles OK with teensy 3 but not the GCC command line used by Teensy 2.
Code:
struct foo_t
{
int me;
};
struct foo_t =
{
.me = 123;
};