bug-bison
[Top][All Lists]
Advanced

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

Re: bison-2.0a feedback


From: Paul Eggert
Subject: Re: bison-2.0a feedback
Date: Wed, 25 May 2005 12:51:18 -0700
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.4 (gnu/linux)

Bruno Haible <address@hidden> writes:

> Some test results of bison-2.0a.

Thanks for reporting these.

> /boot/home/gnubuild/bison-2.0a/src/scan-gram.l:134: warning: `braces_level' 
> might be used uninitialized in this function

To pacify GCC for incorrect warnings about uninitialized variables,
you can compile with -Dlint.  This is the convention used by
coreutils.  Hmm, it's a bit awkward though, since it means people have
to remember to use -Dlint.

> subpipe.c:103: warning: variable `from_in_fd' might be clobbered by `longjmp' 
> or `vfork'

I take it that it's OK to put information into an array rather than a
variable that might be put into a register?  The patch below does that.
I hope it fixes things for FreeBSD 4.0 i386 with gcc-2.95.3.

> 2005-05-24  Bruno Haible  <address@hidden>
>
>       * tests/synclines.at (AT_SYNCLINES_COMPILE): Add support for the
>       error message syntax used by gcc-4.0.

Thanks for doing that.  I assume "Fehler" should be "error" in an
English locale.

I installed this patch to attempt to fix the glitches you reported
(other than the -Dlint one).

2005-05-25  Paul Eggert  <address@hidden>

        Fix BeOS, FreeBSD, MacOS porting problems reported by Bruno Haible.
        * lib/bitset.c (bitset_print): Don't assume size_t can be printed
        with %d format.
        * lib/ebitset.c (min, max): Undef before defining.
        * lib/vbitset.c (min, max): Likewise.
        * lib/subpipe.c (create_subpipe): Save local variables in case
        vfork clobbers them.

2005-05-24  Bruno Haible  <address@hidden>

        * tests/synclines.at (AT_SYNCLINES_COMPILE): Add support for the
        error message syntax used by gcc-4.0.

Index: lib/bitset.c
===================================================================
RCS file: /cvsroot/bison/bison/lib/bitset.c,v
retrieving revision 1.12
diff -p -u -b -w -r1.12 bitset.c
--- lib/bitset.c        14 May 2005 06:49:47 -0000      1.12
+++ lib/bitset.c        25 May 2005 19:43:32 -0000
@@ -1,5 +1,5 @@
 /* General bitsets.
-   Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
    Contributed by Michael Hayes (address@hidden).
 
    This program is free software; you can redistribute it and/or modify
@@ -307,7 +307,7 @@ bitset_print (FILE *file, bitset bset, b
        pos = 0;
       }
 
-    fprintf (file, "%d ", i);
+    fprintf (file, "%lu ", (unsigned long int) i);
     pos += 1 + (i >= 10) + (i >= 100);
   };
 
Index: lib/ebitset.c
===================================================================
RCS file: /cvsroot/bison/bison/lib/ebitset.c,v
retrieving revision 1.15
diff -p -u -b -w -r1.15 ebitset.c
--- lib/ebitset.c       14 May 2005 06:49:47 -0000      1.15
+++ lib/ebitset.c       25 May 2005 19:43:32 -0000
@@ -1,5 +1,5 @@
 /* Functions to support expandable bitsets.
-   Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
    Contributed by Michael Hayes (address@hidden).
 
    This program is free software; you can redistribute it and/or modify
@@ -115,11 +115,11 @@ static ebitset_elt *ebitset_free_list;    /
  ((BSET)->b.cindex = (EINDEX) * EBITSET_ELT_WORDS, \
   (BSET)->b.cdata = EBITSET_WORDS (EBITSET_ELTS (BSET) [EINDEX]))
 
-
+#undef min
+#undef max
 #define min(a, b) ((a) > (b) ? (b) : (a))
 #define max(a, b) ((a) > (b) ? (a) : (b))
 
-
 static bitset_bindex
 ebitset_resize (bitset src, bitset_bindex n_bits)
 {
Index: lib/subpipe.c
===================================================================
RCS file: /cvsroot/bison/bison/lib/subpipe.c,v
retrieving revision 1.4
diff -p -u -b -w -r1.4 subpipe.c
--- lib/subpipe.c       22 May 2005 08:04:06 -0000      1.4
+++ lib/subpipe.c       25 May 2005 19:43:32 -0000
@@ -114,6 +114,13 @@ create_subpipe (char const * const *argv
       || (from_out_fd = fd_safer (pipe_fd[1])) < 0)
     error (EXIT_FAILURE, errno, "pipe");
 
+  /* Save the local variables in the parent now, in case vfork
+     clobbers them.  */
+  fd[0] = to_out_fd;
+  fd[1] = from_in_fd;
+  pipe_fd[0] = to_in_fd;
+  pipe_fd[1] = from_out_fd;
+
   pid = vfork ();
   if (pid < 0)
     error (EXIT_FAILURE, errno, "fork");
@@ -137,10 +144,8 @@ create_subpipe (char const * const *argv
     }
 
   /* Parent.  */
-  close (to_in_fd);
-  close (from_out_fd);
-  fd[0] = to_out_fd;
-  fd[1] = from_in_fd;
+  close (pipe_fd[0]);
+  close (pipe_fd[1]);
   return pid;
 }
 
Index: lib/vbitset.c
===================================================================
RCS file: /cvsroot/bison/bison/lib/vbitset.c,v
retrieving revision 1.5
diff -p -u -b -w -r1.5 vbitset.c
--- lib/vbitset.c       14 May 2005 06:49:47 -0000      1.5
+++ lib/vbitset.c       25 May 2005 19:43:32 -0000
@@ -1,5 +1,5 @@
 /* Variable array bitsets.
-   Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
    Contributed by Michael Hayes (address@hidden).
 
    This program is free software; you can redistribute it and/or modify
@@ -48,7 +48,8 @@ static bitset_bindex vbitset_list_revers
 #define VBITSET_SIZE(X) ((X)->b.csize)
 #define VBITSET_ASIZE(X) ((X)->v.size)
 
-
+#undef min
+#undef max
 #define min(a, b) ((a) > (b) ? (b) : (a))
 #define max(a, b) ((a) > (b) ? (a) : (b))
 
Index: tests/synclines.at
===================================================================
RCS file: /cvsroot/bison/bison/tests/synclines.at,v
retrieving revision 1.11
diff -p -u -b -w -r1.11 synclines.at
--- tests/synclines.at  14 May 2005 06:49:48 -0000      1.11
+++ tests/synclines.at  25 May 2005 19:43:32 -0000
@@ -1,5 +1,5 @@
 # Executing Actions.                               -*- Autotest -*-
-# Copyright (C) 2002, 2004 Free Software Foundation, Inc.
+# Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -29,11 +29,13 @@ m4_define([AT_SYNCLINES_COMPILE],
 [AT_CHECK([$CC $CFLAGS $CPPFLAGS -c $1], [ignore], [], [stderr])
 # In case GCC displays column information, strip it down.
 #
-#   input.y:4:2: #error "4"    or input.y:4.2: #error "4"
+#   input.y:4:2: #error "4"    or
+#   input.y:4.2: #error "4"    or
+#   input.y:4:2: error: #error "4"
 # =>
 #   input.y:4: #error "4"
 #
-AT_CHECK([[sed 's/^\([^:]*:[^:.]*\)[.:][^:]*:\(.*\)$/\1:\2/' stderr]], 0, 
[stdout])
+AT_CHECK([[sed -e 's/^\([^:]*:[^:.]*\)[.:][^:]*:\(.*\)$/\1:\2/' -e 
's/^\([^:]*:[^:]*:\)address@hidden:@]*\( @%:@error\)/\1\2/' stderr]], 0, 
[stdout])
 ])
 
 # AT_TEST_SYNCLINE(TITLE, INPUT, ERROR-MSG)




reply via email to

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