Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 4829

General • Re: How to report compile time values ?

$
0
0
Just an update to say I resolved my problem. Having discovered the built-in means to get the unported code to show the values it was using at run time, I knew what to expect with just a couple of compilations and runs. I then crafted a test harness which could run on my Pi and report what I was generating.

And that did reveal on 'off by one' error in one of the values I had. Ironically not in the 'enum' I was focused upon but in a '#define' sequence which builds up a total, basically -

Code:

#define baseA (                        0x81  )#define baseB (( quantityA * sizeA ) + baseA )#define baseC (( quantityB * sizeB ) + baseB )#define next  (( quantityC * sizeC ) + baseC )#define total ( next & 0x7F )
I hadn't noticed I was effectively starting from 1 rather than 0 so had erroneously added another 1 to my 'total'.

Statistics: Posted by hippy — Mon Mar 25, 2024 2:02 pm



Viewing all articles
Browse latest Browse all 4829

Trending Articles