posix error with gcc3.0

Ralf Corsepius corsepiu at faw.uni-ulm.de
Wed Jun 20 15:51:24 UTC 2001


Joel Sherrill wrote:
> 
> Jerry Needell wrote:
> 
> > I get the following error when building the 20010525 snapshot with
> > gcc-3.0-20010614 if I use --enable-posix.  This seems like it may be
> > something of general interest. Anyone know waht is going on here?
> 
> Not 100%.  I think that it may be saying that you can't do this anymore:
> 
>   mode = (mode_t) va_arg( arg, mode_t );
> 
> I (think) it is saying that the 2nd argument to va_arg should be int not
> mode_t but I am not 100% sure about that.
I am inclinded to agree.

> Anyone else have ideas?
The responsible typedef seems to be this one from newlib's
sys/types.h:

#ifdef __MS_types__
typedef char *  addr_t;
typedef int mode_t;
#else
#if defined (__sparc__) && !defined (__sparc_v9__)
#ifdef __svr4__
typedef unsigned long mode_t;
#else
typedef unsigned short mode_t;
#endif
#else 
typedef unsigned int mode_t _ST_INT32;
#endif
#endif /* ! __MS_types__ */

Now, if somebody could explain why the sparc is treated special and
why it is implemented this way (long, short, int), then we probably
have the cause.

AFAIU, either 
* mode_t can't be treated with va_args anymore (i.e. mode_t is
short? -> bug in RTEMS?)
* mode_t should not be defined as short (Why should it be short?
History, compatibility (to what?) -> bug in newlib?)

Ralf



More information about the users mailing list