Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compiling via arduino IDE for ESP32-C3 (using g++) : error because of designated initalizers #178

Open
sfosset opened this issue Oct 14, 2024 · 0 comments

Comments

@sfosset
Copy link

sfosset commented Oct 14, 2024

To day I tried compiling a sketch using electricui-embedded 0.8.0 (installed via Arduino IDE).
The target is Seeduino XIAO ESP32.
The IDE tries to compile with this line (using g++) :

AppData\\Local\\Arduino15\\packages\\esp32\\tools\\esp-rv32\\2302/bin/riscv32-esp-elf-g++" -MMD -c

I get the following error when using the macros for setting up the tracked variables

libraries\electricui-embedded\src/eui_macro.h:49:105: error: either all initializer clauses should be designated or none of them should be
49 | #define EUI_CUSTOM_RO( ID, DATA ) { .id = ID, .type = TYPE_CUSTOM|READ_ONLY_MASK, .size = sizeof(DATA), {.data = &DATA} }

The error is pretty self-explanatory : I manually added the .ptr= name in front of all {.data = &DATA} in eui_macro.h, and it compiled successfully.
Maybe you can consider adding this change to the next release to have more compatibility with C++ compilers ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant