bug-m4
[Top][All Lists]
Advanced

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

m4-1.4.10


From: Tim Rice
Subject: m4-1.4.10
Date: Sun, 28 Oct 2007 18:15:31 -0700 (PDT)


It looks like there are some regressions in 1.4.10 on some of my platforms.

On my UnixWare 7.1.1 box I needed to patch lib/fpurge.c and lib/freading.c
just to get it to compile. I got errors like
....
UX:acomp: ERROR: "/opt/src/gnu/m4-1.4.10/lib/fpurge.c", line 95: undefined 
struct/union member: _ptr
....

Looking at stdio.h I see
....
typedef struct _FILE_
{
    int             __cnt;          /* num. avail. characters in buffer */
    unsigned char   *__ptr;         /* next character from/to here */
    unsigned char   *__base;        /* the buffer (not really) */
    unsigned char   __flag;         /* the state of the stream */
    unsigned char   __file;         /* file descriptor (not necessarily) */
    unsigned char   __buf[2];       /* micro buffer as a fall-back */
} FILE;
....
so I patched like this
....
--- m4-1.4.10/lib/fpurge.c.old  2007-07-05 04:48:00.000000000 -0700
+++ m4-1.4.10/lib/fpurge.c      2007-10-19 19:59:28.758956004 -0700
@@ -92,9 +92,9 @@
     }
   return 0;
 # elif defined _IOERR               /* AIX, HP-UX, IRIX, OSF/1, Solaris, mingw 
*/
-  fp->_ptr = fp->_base;
-  if (fp->_ptr != NULL)
-    fp->_cnt = 0;
+  fp->__ptr = fp->__base;
+  if (fp->__ptr != NULL)
+    fp->__cnt = 0;
   return 0;
 # elif defined __UCLIBC__           /* uClibc */
 #  ifdef __STDIO_BUFFERS
--- m4-1.4.10/lib/freading.c.old        2007-07-05 04:48:00.000000000 -0700
+++ m4-1.4.10/lib/freading.c    2007-10-22 20:44:16.222527001 -0700
@@ -37,7 +37,7 @@
 #elif defined __sferror             /* FreeBSD, NetBSD, OpenBSD, MacOS X, 
Cygwin */
   return (fp->_flags & __SRD) != 0;
 #elif defined _IOERR                /* AIX, HP-UX, IRIX, OSF/1, Solaris, mingw 
*/
-  return (fp->_flag & _IOREAD) != 0;
+  return (fp->__flag & _IOREAD) != 0;
 #elif defined __UCLIBC__            /* uClibc */
   return (fp->__modeflags & (__FLAG_READONLY | __FLAG_READING)) != 0;
 #else
....

Additionally my OpenServer 5.0.4 box has no fseeko so it needed
lib/fseeko.c patched.
.....
--- lib/fseeko.c.old    2007-07-05 04:48:02.000000000 -0700
+++ lib/fseeko.c        2007-10-23 14:25:22.851251004 -0700
@@ -80,8 +80,8 @@
   if (fp_->_ptr == fp_->_base
       && (fp_->_ptr == NULL || fp_->_cnt == 0))
 # else
-  if (fp->_ptr == fp->_base
-      && (fp->_ptr == NULL || fp->_cnt == 0))
+  if (fp->__ptr == fp->__base
+      && (fp->__ptr == NULL || fp->__cnt == 0))
 # endif
 #elif defined __UCLIBC__            /* uClibc */
   if (((fp->__modeflags & __FLAG_WRITING) == 0
.....

The comments in that section of code mention AIX, HP-UX, IRIX, OSF/1,
Solaris, & mingw. Of those I only have Solaris here and with the above
patches Solaris 8 & 10 still build fine and pass tests.

On UnixWare 7.1.1 test-closein.sh fails.
....
./test-closein: error closing file: Illegal seek
FAIL: test-closein.sh
....
After reading up on the OpenGroup's onlinepubs for fseeko(), I came
up with this patch.

.....
--- lib/closein.c.old   2007-05-30 18:30:16.000000000 -0700
+++ lib/closein.c       2007-10-22 22:32:48.958287004 -0700
@@ -82,8 +82,10 @@

   /* Only attempt flush if stdin is seekable, as fflush is entitled to
      fail on non-seekable streams.  */
+  errno = 0;
   if (fseeko (stdin, 0, SEEK_CUR) == 0 && fflush (stdin) != 0)
-    fail = true;
+    if(errno != ESPIPE)
+        fail = true;
   if (close_stream (stdin) != 0)
     fail = true;
   if (fail)
.....

On UnixWare 7.1.1 test-vasprintf-posix fails.
.....
/opt/src/gnu/m4-1.4.10/tests/test-vasprintf-posix.c:203: assertion
failed
/bin/ksh: line 1: 13351: Abort(coredump)
FAIL: test-vasprintf-posix
.....
I have not found a fix for this yet.


The build fails on Caldera OpenLinux 3.1.1
Here is a snipet of the build log
....
make  all-am
make[2]: Entering directory `/usr/local/src/gnu/m4-1.3.10/lib'
source='/opt/src/gnu/m4-1.4.10/lib/gl_array_list.c' object='gl_array_list.o' 
libtool=no \
DEPDIR=.deps depmode=none /bin/ksh /opt/src/gnu/m4-1.4.10/depcomp \
cc  -I. -I/opt/src/gnu/m4-1.4.10/lib     -g -c 
/opt/src/gnu/m4-1.4.10/lib/gl_array_list.c
In file included from /opt/src/gnu/m4-1.4.10/lib/gl_array_list.h:22,
                 from /opt/src/gnu/m4-1.4.10/lib/gl_array_list.c:22:
/opt/src/gnu/m4-1.4.10/lib/gl_list.h:99: parse error before `*'
/opt/src/gnu/m4-1.4.10/lib/gl_list.h:99: `_Bool' declared as function returning 
a function
/opt/src/gnu/m4-1.4.10/lib/gl_list.h:133: parse error before 
`gl_listelement_equals_fn'
....
I suspect 1.4.10 may not have been tested using gcc version 2.95.2.


The build fails on OpenServer 5.0.4 using the native compiler.
.....
source='/opt/src/gnu/m4-1.4.10/lib/isnanf.c' object='isnanf.o' libtool=no \
DEPDIR=.deps depmode=none /bin/ksh /opt/src/gnu/m4-1.4.10/depcomp \
cc  -I. -I/opt/src/gnu/m4-1.4.10/lib     -g -c 
/opt/src/gnu/m4-1.4.10/lib/isnanf.c
"/opt/src/gnu/m4-1.4.10/lib/isnan.c", line 121: error: division by 0
"/opt/src/gnu/m4-1.4.10/lib/isnan.c", line 122: error: division by 0
"/opt/src/gnu/m4-1.4.10/lib/isnan.c", line 123: error: division by 0
gmake[2]: *** [isnanf.o] Error 1
.....
If I switch to a gcc build, it doesn't fail until building the test
programs.
.....
source='/opt/src/gnu/m4-1.4.10/tests/test-stdint.c' object='test-stdint.o' 
libtool=no \
DEPDIR=.deps depmode=gcc /bin/ksh /opt/src/gnu/m4-1.4.10/depcomp \
gcc  -I. -I../lib -I/opt/src/gnu/m4-1.4.10/tests  -I. 
-I/opt/src/gnu/m4-1.4.10/tests -I.. -I/opt/src/gnu/m4-1.4.10/tests/.. -I../lib 
-I/opt/src/gnu/m4-1.4.10/tests/../lib   -g -O2 -c 
/opt/src/gnu/m4-1.4.10/tests/test-stdint.c
/opt/src/gnu/m4-1.4.10/tests/test-stdint.c:309: negative width in bit-field 
`verify_error_if_negative_size__'
/opt/src/gnu/m4-1.4.10/tests/test-stdint.c:310: negative width in bit-field 
`verify_error_if_negative_size__'
gmake[4]: *** [test-stdint.o] Error 1
.....

If you have any ideas how to fix the test-vasprintf-posix failure on
the UnixWare 7.1.1 box, I'd love to hear them.

Thanks.

--
Tim Rice                                Multitalents    (707) 887-1469
address@hidden





reply via email to

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