]> git.saurik.com Git - bison.git/commitdiff
Work around portability problems with Visual Age C compiler
authorPaul Eggert <eggert@cs.ucla.edu>
Tue, 11 Oct 2005 05:06:16 +0000 (05:06 +0000)
committerPaul Eggert <eggert@cs.ucla.edu>
Tue, 11 Oct 2005 05:06:16 +0000 (05:06 +0000)
(xlc and xlC_r) reported by John P. Hartmann.
* data/location.cc (initial_column, initial_line): Remove.
All uses replaced by 0 and 1.
* src/scan-gram.l (gram_wrap): Redefine to avoid bug in flex 2.5.31
that xlc complains about.
* src/scan-skel.l (skel_wrap): Likewise.

ChangeLog
data/location.cc
src/scan-gram.l
src/scan-skel.l

index f1b332cb591e4a36752c4bfafcc534c3e93601ca..2cef5302bf27f227adb377d69e3cf896807d0b12 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2005-10-10  Paul Eggert  <eggert@cs.ucla.edu>
+
+       Work around portability problems with Visual Age C compiler
+       (xlc and xlC_r) reported by John P. Hartmann.
+       * data/location.cc (initial_column, initial_line): Remove.
+       All uses replaced by 0 and 1.
+       * src/scan-gram.l (gram_wrap): Redefine to avoid bug in flex 2.5.31
+       that xlc complains about.
+       * src/scan-skel.l (skel_wrap): Likewise.
+
 2005-10-10  Akim Demaille  <akim@epita.fr>
 
        * examples/calc++/test: Be quiet unless VERBOSE.
index 2226adca7aa28c5b75dd5f247e57763700e26d91..bb701b3ea028aa3acf279b678f6302f9a122b0e8 100644 (file)
@@ -43,20 +43,14 @@ namespace yy
   /// Abstract a position.
   class position
   {
-  public:
-    /// Initial column number.
-    static const unsigned int initial_column = 0;
-    /// Initial line number.
-    static const unsigned int initial_line = 1;
-
     /** \name Ctor & dtor.
      ** \{ */
   public:
     /// Construct a position.
     position () :
       filename (0),
-      line (initial_line),
-      column (initial_column)
+      line (1),
+      column (0)
     {
     }
     /** \} */
@@ -68,19 +62,19 @@ namespace yy
     /// (line related) Advance to the COUNT next lines.
     inline void lines (int count = 1)
     {
-      column = initial_column;
+      column = 0;
       line += count;
     }
 
     /// (column related) Advance to the COUNT next columns.
     inline void columns (int count = 1)
     {
-      int leftmost = initial_column;
+      int leftmost = 0;
       int current  = column;
       if (leftmost <= current + count)
        column += count;
       else
-       column = initial_column;
+       column = 0;
     }
     /** \} */
 
index 1b44f5137a9bded1bc90c9e9894ac43ad2dadfc5..70d56ee90ec48f11d13968fe2b32b68dbdd1a9f1 100644 (file)
 %option prefix="gram_" outfile="lex.yy.c"
 
 %{
+/* Work around a bug in flex 2.5.31.  See Debian bug 333231
+   <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=333231>.  */
+#undef gram_wrap
+#define gram_wrap() 1
+
 #include "system.h"
 
 #include <mbswidth.h>
index 4f34a6c67716aacb303736269c61c52186917ed9..06370fa6dedca1012806dd4ef4257a9d71412c53 100644 (file)
 %option prefix="skel_" outfile="lex.yy.c"
 
 %{
+/* Work around a bug in flex 2.5.31.  See Debian bug 333231
+   <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=333231>.  */
+#undef skel_wrap
+#define skel_wrap() 1
+
 #include "system.h"
 
 #include <error.h>