[tlbuild] Broken tests for mendexk on arm

Karl Berry karl at freefriends.org
Sun May 9 23:28:16 CEST 2021


    > These changes broke mendexk tests or arm (Raspberry PI; armhf-linux &
    > aarch64-linux):

The code assumed that char values were signed (comparisons with < 0),
but apparently on aarch64 char is unsigned by default.

When I changed the type to int, the tests worked. Committed in r59151:

    --- mendex.h	(revision 59144)
    +++ mendex.h	(working copy)
     struct page {
            char *page;
            char *enc;
    -	char attr[3];
    +	int attr[3];
     };

I hope that fixes it (did for me). Let me know if problems persist.

Also:
- added one more test, even simpler, to which I had reduced the problem.
- "preventively" changed another char declaration to unsigned char, the
index.words member. (Otherwise I suspect that if its value was >128,
there would be undefined behavior.)
- factored out a couple common (and complex) expressions in fwrite.c.

Takuji ... hope all that is ok.

Special thanks to Nelson for giving me access to an aarch64 system from
his apparently infinite farm of systems :). --thanks, karl.


More information about the tlbuild mailing list.