Trying to build Seven Kingdoms: Ancient Adversaries from release 2.15.5 using MSYS2 on Win10 x64.
My invocation is ./configure --prefix=/dbg CPPFLAGS=-DDEBUG CFLAGS="-g -O0" && make
(adapted from here, I have never before used autotools).
I get this compile error, which looks legit:
In file included from ../include/ALL.h:33,
from OCOLTBL.cpp:25:
OCOLTBL.cpp: In member function 'void ColorTable::generate_table(int, PalDesc&, RGBColor (*)(RGBColor, int, int))':
OCOLTBL.cpp:194:54: error: ordered comparison of pointer with integer zero ('BYTE*' {aka 'unsigned char*'} and 'int')
194 | err_when(absScale < 0 || palD.reserved_color < 0 || palD.pal == NULL);
| ~~~~~~~~~~~~~~~~~~~~^~~
../include/OERROR.h:52:32: note: in definition of macro 'err_when'
52 | #define err_when(cond) if(cond) err.internal(NULL,__FILE__, __LINE__)
| ^~~~
Indeed the left hand side of this comparison is defined as unsigned char *
.
I must be too young, for a change, to recognise this expression as sensible: In my time a pointer has always either been equal to nullptr
(effectively 0) as per [conv.ptr] and [expr.eq] or been presumably-valid (no way to know for sure before dereferencing). "Negative" pointers are not a thing.
How was ptr < 0
supposed to work in the past, if ever, and how was it defined the last time before becoming invalid?