bug-gnulib
[Top][All Lists]
Advanced

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

Re: fpurge.c, freadahead.c, freading.c make wrong assumption


From: Roger Cornelius
Subject: Re: fpurge.c, freadahead.c, freading.c make wrong assumption
Date: Fri, 14 Mar 2008 13:56:25 -0400
User-agent: Mutt/1.5.17 (2007-11-01)

On 03/14/2008 01:32, Bruno Haible wrote:
> Hi,
> 
> Roger Cornelius wrote:
> > >  When _IOERR is defined, fpurge.c, freadahead.c, and freading.c wrongly
> > >  assume FILE struct members are named with a single leading "_"
> > >  character.  E.g., this section of code at line 95 of fpurge.c:
> > >
> > >  # elif defined _IOERR               /* AIX, HP-UX, IRIX, OSF/1, Solaris, 
> > > mingw */
> > >   fp->_ptr = fp->_base;
> > >   if (fp->_ptr != NULL)
> > >     fp->_cnt = 0;
> > >   return 0;
> > >  # elif defined __UCLIBC__           /* uClibc */
> > >
> > >
> > >  In the case of SCO OpenServer and Unixware, this assumption is wrong.
> > >  On these OS'es, FILE struct members are named using two leading "_"
> > >  characters.
> 
> 1) On HP-UX the fields also are called __base etc. but there are
>    #define _base __base
>    definitions which make it work nevertheless. Can you look whether the
>    stdio.h on your system has a similar thing, and if so, what needs to be
>    done to trigger the single-underscore names?
> 
> 2) Can you provide a compile-time check for this platform? (The info on
>    http://predef.sourceforge.net/ does not appear to be complete in this 
> case.)
>    What's the result of
> 
>    $ touch empty.c
>    $ gcc -E -dM empty.c | sort

Hi, to answer question 1, there are no #defines to relate the __ struct
members to _ members in any files under /usr/include on either
OpenServer 507 or OpenServer 6.  I don't have access to a Unixware box
currently so can't comment on it.

For question 2, I'm building with the native compiler and not gcc, but
I've tried both and both have the problem.

Here's the output of 'gcc -E -dM empty.c | sort':

#define _SCO_DS 2
#define _SCO_DS_LL 1
#define _SCO_ELF 1
#define __CHAR_BIT__ 8
#define __DBL_DENORM_MIN__ 4.9406564584124654e-324
#define __DBL_DIG__ 15
#define __DBL_EPSILON__ 2.2204460492503131e-16
#define __DBL_HAS_INFINITY__ 1
#define __DBL_HAS_QUIET_NAN__ 1
#define __DBL_MANT_DIG__ 53
#define __DBL_MAX_10_EXP__ 308
#define __DBL_MAX_EXP__ 1024
#define __DBL_MAX__ 1.7976931348623157e+308
#define __DBL_MIN_10_EXP__ (-307)
#define __DBL_MIN_EXP__ (-1021)
#define __DBL_MIN__ 2.2250738585072014e-308
#define __DECIMAL_DIG__ 21
#define __ELF__ 1
#define __FINITE_MATH_ONLY__ 0
#define __FLT_DENORM_MIN__ 1.40129846e-45F
#define __FLT_DIG__ 6
#define __FLT_EPSILON__ 1.19209290e-7F
#define __FLT_EVAL_METHOD__ 2
#define __FLT_HAS_INFINITY__ 1
#define __FLT_HAS_QUIET_NAN__ 1
#define __FLT_MANT_DIG__ 24
#define __FLT_MAX_10_EXP__ 38
#define __FLT_MAX_EXP__ 128
#define __FLT_MAX__ 3.40282347e+38F
#define __FLT_MIN_10_EXP__ (-37)
#define __FLT_MIN_EXP__ (-125)
#define __FLT_MIN__ 1.17549435e-38F
#define __FLT_RADIX__ 2
#define __GNUC_MINOR__ 4
#define __GNUC_PATCHLEVEL__ 4
#define __GNUC__ 3
#define __GXX_ABI_VERSION 1002
#define __INT_MAX__ 2147483647
#define __LDBL_DENORM_MIN__ 3.64519953188247460253e-4951L
#define __LDBL_DIG__ 18
#define __LDBL_EPSILON__ 1.08420217248550443401e-19L
#define __LDBL_HAS_INFINITY__ 1
#define __LDBL_HAS_QUIET_NAN__ 1
#define __LDBL_MANT_DIG__ 64
#define __LDBL_MAX_10_EXP__ 4932
#define __LDBL_MAX_EXP__ 16384
#define __LDBL_MAX__ 1.18973149535723176502e+4932L
#define __LDBL_MIN_10_EXP__ (-4931)
#define __LDBL_MIN_EXP__ (-16381)
#define __LDBL_MIN__ 3.36210314311209350626e-4932L
#define __LONG_LONG_MAX__ 9223372036854775807LL
#define __LONG_MAX__ 2147483647L
#define __NO_INLINE__ 1
#define __OPENSERVER6__ 1
#define __PTRDIFF_TYPE__ int
#define __REGISTER_PREFIX__ 
#define __SCHAR_MAX__ 127
#define __SHRT_MAX__ 32767
#define __SIZE_TYPE__ unsigned int
#define __STDC_HOSTED__ 1
#define __UNIXWARE__ 1
#define __USER_LABEL_PREFIX__ 
#define __VERSION__ "3.4.4"
#define __WCHAR_MAX__ 2147483647
#define __WCHAR_TYPE__ long int
#define __WINT_TYPE__ long int
#define __i386 1
#define __i386__ 1
#define __tune_i586__ 1
#define __tune_pentium__ 1
#define i386 1

-- 
Roger Cornelius        address@hidden




reply via email to

[Prev in Thread] Current Thread [Next in Thread]