[Top][All Lists]

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

Re: m4 1.4.10

From: grg2
Subject: Re: m4 1.4.10
Date: Mon, 13 Aug 2007 15:44:20 +0000

> Also, you still didn't comment on this:
> > Also, it looks like
> > your stdio.h is older than the version that Bruno was looking at when he
> > wrote the code to use FILE._ext; I wonder if using fp->_ub from two lines
> > later in fseeko.c, rather than the fp_ub macro associated with __OpenBSD__
> > would make a difference.

I didn't comment on it as it looked too deep for me.... 

But following the chain of macro expansions shows that there's something wrong 
with the conditionalizing... NetBSD seems to define the ungetc buffer as "_ub", 
but the conditionals choose the other option that does something like a blind 
cast to some "_ext" structure.    

I'm not familiar with all the special historical and hysterical circumstances 
the conditionals are checking for, so I'm definitely not the right person to 
suggest the solution!

The code:

  /* These tests are based on fpurge.c.  */
#if defined _IO_ferror_unlocked     /* GNU libc, BeOS */
  if (fp->_IO_read_end == fp->_IO_read_ptr
      && fp->_IO_write_ptr == fp->_IO_write_base
      && fp->_IO_save_base == NULL)
#elif defined __sferror             /* FreeBSD, NetBSD, OpenBSD, MacOS X, 
Cygwin */
# if defined __NetBSD__ || defined __OpenBSD__ /* NetBSD, OpenBSD */
   /* See 
b-markup> */
#  define fp_ub ((struct { struct __sbuf _ub; } *) fp->_ext._base)->_ub
# else                                         /* FreeBSD, MacOS X, Cygwin */
#  define fp_ub fp->_ub
# endif

reply via email to

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