#if TOTAL != <expected value>
Thanks, and for the explanation why the first, and what I was doing, doesn't work._Static_assert (TOTAL == 1, "TOTAL does not have expected value");
The problem with both is that I don't know what TOTAL should be in advance for the various options I can set in the original code.
I was hoping to try various combinations in the original code, compile those, and see what values I got for each. Then compile the ported code and confirm the values match.
I guess I can compile the original with various combinations and report what the values are at run time, then set the ported code expected values and compile those. It's more involved than I was hoping for but should work.
I could potentially connect up a UART but but imagined I could simply convince the compiler to tell me what values were being used. I guess I could concoct some assignment and then see what value is being loaded in a disassembly.
Lightbulb moment : I can compile the code for Pi hosting, run it on a Pi where it won't actually use USB, but can print run-time values.
I was also hoping to have something like -
Code:
char * info[] = { "You have used " STR(TOTAL) " things", "More things",};Statistics: Posted by hippy — Sat Mar 16, 2024 8:51 pm