Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 29 Nov 1995 12:31:02 -0500
From:      Thomas David Rivers <ponds!rivers@dg-rtp.dg.com>
To:        freebsd-bugs@freefall.FreeBSD.org, freebsd-hackers@freefall.FreeBSD.org, rivers@dg-rtp.dg.com
Subject:   Strangeness in /usr/include/runetype.h?
Message-ID:  <199511291731.MAA00373@ponds.UUCP>

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

 ...


 indicating 'rune_t' wasn't defined.



 There is a note in /usr/include/machine/ansi.h:

 * Note that _WCHAR_T_ and _RUNE_T_ must be of the same type.  When wchar_t
 * and rune_t are typedef'd, _WCHAR_T_ will be undef'd, but _RUNE_T remains
 * defined for ctype.h.
 */
#define _BSD_WCHAR_T_   int                     /* wchar_t */
#define _BSD_RUNE_T_    int                     /* rune_t */



 And, finally, in /usr/include/runetype.h we have:

#ifdef  _BSD_WCHAR_T_
typedef _BSD_WCHAR_T_   rune_t;
typedef _BSD_WCHAR_T_   wchar_t;
#undef  _BSD_WCHAR_T_
#endif


 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


 I discovered this on a 2.0.5 system, but I looked on freefall.cdrom.com
(which claims to be running 2.1-STABLE) and discovered this hasn't changed
there.

	- Dave Rivers -





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199511291731.MAA00373>