The at89x51.h header file appears to have collected a typo in [r13538] as the code was being refactored from using __sbit to SBIT macros, from [r7442] thru [r13530] to finally [r13538].
Specifically, line 80 in https://sourceforge.net/p/sdcc/code/HEAD/tree/trunk/sdcc/device/include/mcs51/at89x51.h#l80
currently: SBIT(TR1, 0x88, E);
should be SBIT(TR1, 0x88, 6);
As is, if the specific at89x51.h header is used instead of general mcs51reg.h header, we of course get a compiler error:
#include <at89x51.h>
...
/opt/homebrew/bin/../share/sdcc/include/mcs51/at89x51.h:80: error 20: Undefined identifier 'E'
/opt/homebrew/bin/../share/sdcc/include/mcs51/at89x51.h:80: error 2: Initializer element is not a constant expression
I checked other files touched in the refactoring, but this appears to be the only file affected.
PS: Sorry, I would try and submit a patch instead of just a bug report, but I am not a regular here so I haven't yet figured out if that is possible or welcome.
Fixed in [r15529]. Thanks.
Related
Commit: [r15529]