[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Bug#153948: Need help with afio on powerpc



Stephen van Egmond (svanegmond@tinyplanet.ca) wrote:
> So I've narrowed the problem to the archive-testing routine.

Found it.    It makes me want to hurt something, it's so stupid.

afio.h says:

void inalloc();

afio.c says:

STATIC void
inalloc (len)
     reg uint len;



inalloc is called in some circumstances with an off_t.  When we are on 
a big-endian system, and compiling with 64 bit off_t's, this means
that inalloc ALWAYS sees len=0 (for the typically small offsets we deal
with).

Clearly, gcc allowing through such retarded syntax in afio.h is considered a
feature somewhere, by somebody.  I sure wish it didn't, because such
bugs can't be caught at compile time otherwise!

The solution:

afio.h:

void inalloc(off_t)

afio.c:

STATIC void inalloc(off_t len)


There are other similar bugs lurking in the system that will probably
affect big-endian systems, and 64-bit systems regardless of endianness.
I strongly recommend modernising the codebase to use sensible function
declarations.  The style in use right now reflects the code's 1980s
origins, and is pointless these days.

Koen, are you reading this?

-Steve


-- 
To UNSUBSCRIBE, email to debian-powerpc-request@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org



Reply to: