I’ve tried to define a long value for number of seconds in a day with a ‘#define’ and a ‘static const long’. Both get truncated by the preprocessor, but only when the value is calculated.
static const long seconds_in_a_day = 246060; // seconds_in_a_day == 20864
static const long seconds_in_a_day = 86400; // seconds_in_a_day == 86400
86400 == 246060
20864 == 86400 & 0x7fff
Looks like all preprocessor math is done as a 16 bit int. A bit odd, I’ve never seen a preprocessor do this.
I’ve search the forum and can’t seen it discussed. Do you think it’s a bug? Should I report it?