Control: tags -1 pending Hi Lennart,
On Tue, Sep 08, 2020 at 07:23:15PM -0400, Lennart Sorensen wrote: > > I don't have access to an arm64 system at the moment, but a good start > > might be to fix the compiler warnings, such as the array subscript out > > of bounds in global.c line 44. The rest of the warnings appear harmless. > > > > It would appear that GAP_SIZE = 2 is wrong given GAP[] only contains a > > single character. > > I found the actual problem. Someone didn't know that there are 3 types > of char in C. char, signed char and unsigned char. char is _only_ for > use in strings, and never to be used as a numerical value. This is due > to the sign of char being implementation specific. On x86 it is signed, > on arm it is unsigned. So any time you want to work with numerical > values of a char, you must specify if you want signed or unsigned. > Changing char ch to unsigned char ch, made x86 fail the same way arm64 > did, and making it signed char, makes both pass the test. Ahhhh, thanks a lot. I was not aware of this but it sounds very sensible and my guess is that lots of code are affected by the same issue. > So here is a patch that appears to solve the problems in the code. Thanks a lot Andreas. -- http://fam-tille.de