Broken <sys/endian.h> in 5.1R and -current

From: Greg Lewis (glewis_at_misty.eyesbeyond.com)
Date: 06/17/03

  • Next message: Norikatsu Shigemura: "Re: [SUGGEST] CPUTYPE reflects to FFLAGS in bsd.cpu.mk"
    Date: Tue, 17 Jun 2003 09:53:17 -0600
    To: freebsd-hackers@freebsd.org
    
    
    

    Hi all,

    While moving from its own internal endian defines to using <sys/endian.h>
    the JDK 1.3.1 code has become broken on both 5.1R and -current. The
    problem is that C++ code that includes <sys/endian.h> (whether wrapped
    in extern "C" { } or not) fails during compilation with errors such as:

    In file included from ../../../src/share/native/sun/awt/font/FontWrapper.cpp:21:
    /usr/include/sys/endian.h: In function `uint16_t be16dec(const void*)':
    /usr/include/sys/endian.h:97: invalid conversion from `const void*' to `const
       unsigned char*'
    /usr/include/sys/endian.h: In function `uint32_t be32dec(const void*)':
    /usr/include/sys/endian.h:105: invalid conversion from `const void*' to `const
       unsigned char*'
    /usr/include/sys/endian.h: In function `uint64_t be64dec(const void*)':
    /usr/include/sys/endian.h:113: invalid conversion from `const void*' to `const
       unsigned char*'
    [...]
    gmake[3]: *** [../../../build/bsd-i386/tmp/sun/sun.awt.font/fontmanager/obj/FontWrapper.o] Error 1

    The developer who noticed this problem (Munehiro Matsuda - cc'ed) submitted
    the attached patch which simply casts the function arguments to the
    appropriate type.

    Can someone please commit this, approve me to commit it (my commit bit
    is docs and ports :) or suggest an alternative? Thanks.

    A bump of __FreeBSD_version would be great too, since then we could
    detect this and work around it, however I'm not sure this meets the
    criteria for such a bump.

    -- 
    Greg Lewis                          Email   : glewis@eyesbeyond.com
    Eyes Beyond                         Web     : http://www.eyesbeyond.com
    Information Technology              FreeBSD : glewis@FreeBSD.org
    
    
    

    _______________________________________________
    freebsd-hackers@freebsd.org mailing list
    http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
    To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"



  • Next message: Norikatsu Shigemura: "Re: [SUGGEST] CPUTYPE reflects to FFLAGS in bsd.cpu.mk"