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

Bug#216806: aoutloader missing header file for ntohl



Package: xserver-xfree86
Version: 4.2.1-12.1
Severity: normal

This bug is actually relevant to all versions of Xfree86,
including the version in woody, and if you feel my suggestion is
correct, it would be nice to have this fixed upstream as well.

In xc/programs/Xserver/hw/xfree86/loader/aout.h there is 
the rather curious comment:

    /* Get prototype for ntohl */
    #include <ctype.h>

But according to SuSv3:
    http://www.opengroup.org/onlinepubs/007904975/functions/ntohl.html

the proper location for the definition of ntohl is
    #include <arpa/inet.h>

I'm building xfree86 (as well as the rest of Debian) with uClibc,
which implements htonl only as a macro (which is explicitly
allowed per SuSv3).  However this has produced a compile problem
when building xfree86 since aoutloader.c does not end up
including the correct header file, and gcc therefore assumes that
ntohl is supposed to be an extern function.  With glibc, which
provides ntohl as both a macro and as a function, things will
still work even when the prototype is not found.  With uClibc,
which only provides ntohl as a macro, this causes a link error
when trying to use aoutloader.o.

I recommend simply adding
    #include <arpa/inet.h>
to xc/programs/Xserver/hw/xfree86/loader/aout.h.  I have tested
this and it fixes the problem when compiling with uClibc, and
should also prevent a warning when compiling with glibc.  Assuming
you agree and implement my suggestion I further recommend pushing
this fix upstream.

I have checked and this bug is relevant to the versions of
Xfree86 provided in both woody and in testing.  I have not
checked the 4.3 version in experimental but I expect this is 
also relevant there.

 -Erik

--
Erik B. Andersen             http://codepoet-consulting.com/
--This message was written using 73% post-consumer electrons--




Reply to: