bug-bison
[Top][All Lists]
Advanced

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

Re: Compiling bison with non-GCC compilers


From: Akim Demaille
Subject: Re: Compiling bison with non-GCC compilers
Date: 18 Sep 2001 13:20:13 +0200
User-agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Artificial Intelligence)

Finally, I have not applied the __attribute__ part of your patch,
because I just don't understand it.  How come you don't need it for
error.[ch]?

The code I used is used by Jim Meyering in his packages, and I must
confess I don't understand what magic makes it work, but I first need
to better understand what is the difference that makes us fail here
and not there.  Thanks Albert!

Index: ChangeLog
from  Akim Demaille  <address@hidden>

        * src/complain.c: No longer try to be standalone: use system.h.
        Don't assume __STDC__ is defined to 1. Just test if it is defined.
        * src/complain.h: Likewise.
        * src/reduce.c (useless_nonterminals, inaccessable_symbols):
        Remove the unused variable `n'.
        From Albert Chin-A-Young.

Index: THANKS
===================================================================
RCS file: /cvsroot/bison/bison/THANKS,v
retrieving revision 1.10.2.1
diff -u -u -r1.10.2.1 THANKS
--- THANKS 2001/08/28 13:58:27 1.10.2.1
+++ THANKS 2001/09/18 11:09:28
@@ -2,6 +2,7 @@
 it is today without the invaluable help of these people:
 
 Akim Demaille          address@hidden
+Albert Chin-A-Young     address@hidden
 Daniel Hagerty         address@hidden
 David J. MacKenzie     address@hidden
 Fabrice Bauzac         address@hidden
Index: src/complain.c
===================================================================
RCS file: /cvsroot/bison/bison/src/complain.c,v
retrieving revision 1.4
diff -u -u -r1.4 complain.c
--- src/complain.c 2001/08/03 09:38:03 1.4
+++ src/complain.c 2001/09/18 11:09:28
@@ -19,14 +19,10 @@
 /* Based on error.c and error.h,
    written by David MacKenzie <address@hidden>.  */
 
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#include <stdio.h>
+#include "system.h"
 
 #if HAVE_VPRINTF || HAVE_DOPRNT || _LIBC
-# if __STDC__
+# ifdef __STDC__
 #  include <stdarg.h>
 #  define VA_START(args, lastarg) va_start(args, lastarg)
 # else
@@ -119,7 +115,7 @@
 `--------------------------------*/
 
 void
-#if defined VA_START && __STDC__
+#if defined VA_START && defined __STDC__
 warn (const char *message, ...)
 #else
 warn (message, va_alist)
@@ -171,7 +167,7 @@
 `-----------------------------------------------------------*/
 
 void
-#if defined VA_START && __STDC__
+#if defined VA_START && defined __STDC__
 complain (const char *message, ...)
 #else
 complain (message, va_alist)
@@ -221,7 +217,7 @@
 `-------------------------------------------------*/
 
 void
-#if defined VA_START && __STDC__
+#if defined VA_START && defined __STDC__
 fatal (const char *message, ...)
 #else
 fatal (message, va_alist)
@@ -259,7 +255,7 @@
 `------------------------------------------------------------------*/
 
 void
-#if defined VA_START && __STDC__
+#if defined VA_START && defined __STDC__
 error (int status, int errnum,
        const char *message, ...)
 #else
Index: src/complain.h
===================================================================
RCS file: /cvsroot/bison/bison/src/complain.h,v
retrieving revision 1.2
diff -u -u -r1.2 complain.h
--- src/complain.h 2000/11/07 16:28:46 1.2
+++ src/complain.h 2001/09/18 11:09:28
@@ -23,7 +23,7 @@
 extern "C" {
 #endif
 
-#if defined (__STDC__) && __STDC__
+#ifdef __STDC__
 
 /* Informative messages, but we proceed. */
 
Index: src/reduce.c
===================================================================
RCS file: /cvsroot/bison/bison/src/reduce.c,v
retrieving revision 1.19
diff -u -u -r1.19 reduce.c
--- src/reduce.c 2000/12/20 17:21:14 1.19
+++ src/reduce.c 2001/09/18 11:09:30
@@ -117,7 +117,7 @@
 useless_nonterminals (void)
 {
   BSet Np, Ns;
-  int i, n;
+  int i;
 
   /* N is set as built.  Np is set being built this iteration. P is
      set of all productions which have a RHS all in N.  */
@@ -140,7 +140,6 @@
      saved to be used when finding useful productions: only
      productions in this set will appear in the final grammar.  */
 
-  n = 0;
   while (1)
     {
       for (i = WORDSIZE (nvars) - 1; i >= 0; i--)
@@ -171,7 +170,7 @@
 inaccessable_symbols (void)
 {
   BSet Vp, Vs, Pp;
-  int i, n;
+  int i;
   short t;
   rule r;
 
@@ -207,7 +206,6 @@
 
   SETBIT (V, start_symbol);
 
-  n = 0;
   while (1)
     {
       for (i = WORDSIZE (nsyms) - 1; i >= 0; i--)



reply via email to

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