Date: Thu, 30 Nov 1995 16:21:10 +1100 From: Bruce Evans <bde@zeta.org.au> To: freebsd-bugs@freefall.freebsd.org, freebsd-hackers@freefall.freebsd.org, ponds!rivers@dg-rtp.dg.com, rivers@dg-rtp.dg.com Subject: Re: Strangeness in /usr/include/runetype.h? Message-ID: <199511300521.QAA28894@godzilla.zeta.org.au>
next in thread | raw e-mail | index | archive | help
>I've found an interesting situation, try compiling the following >file with -D_POSIX_SOURCE defined: >------------ start ------------- >#include <stdlib.h> >#include <stdio.h> >#include <ctype.h> >------------ end ------------- >You'll get: >In file included from /usr/include/ctype.h:51, > from t.c:4: >/usr/include/runetype.h:58: parse error before `rune_t' >/usr/include/runetype.h:58: warning: no semicolon at end of struct or union >/usr/include/runetype.h:59: warning: data definition has no type or storage class >... > my suggestion is that this becomes: >#ifdef _BSD_WCHAR_T_ >typedef _BSD_WCHAR_T_ rune_t; >typedef _BSD_WCHAR_T_ wchar_t; >#undef _BSD_WCHAR_T_ >#else >typedef _BSD_RUNE_T_ rune_t; >#endif This will result in rune_t sometimes being redefined. Typedefs can't be redefined. <stddef.h> and <stdlib.h> should have something like #ifdef _BSD_WCHAR_T_ typedef _BSD_WCHAR_T_ wchar_t; #undef _BSD_WCHAR_T_ #endif and they should not pollute the namespace by defining rune_t. <runetype.h> should have something like #ifdef _BSD_WCHAR_T_ typedef _BSD_WCHAR_T_ wchar_t; #undef _BSD_WCHAR_T_ #endif typedef _BSD_RUNE_T_ rune_t; <ctype.h> should not pollute the namespace by including <runetype.h> ... Bruce
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199511300521.QAA28894>