I have a header file that declares the array using the extern keyword (empty rank). Then in the main ino file, it is defined with its element size. The macro is defined in the header file but used in another cpp file.
If the array has global scope as defined in the INO file and the header file uses extern in its declaration and each file reads the header file, I thought the INO compiles before the cpp files, so those external functions know about and can use the data in their modules.
thought the INO compiles before the cpp files, so those external functions know about and can use the data in their modules.
then a successful compile would depend on the order that files are compiled
if you define int x[10] in one file, an attempt to do sizeof(x) in another file with extern int x will fail. Even though you specified x[0]. When I tried doing a sizeof() with gcc on my laptop, it errored with "incomplete type int
Yep, I think you’re right. If I rename the offending file from *.cpp to *.ino, the macro expansion works just fine. I guess I’ll drop the macro, as I lose incremental compiles when I have multiple ino files…not worth it.