It seems the YYLLOC_DEFAULT macro recommended by the Bison 1.875 manual
authorTom Lane
Tue, 14 Mar 2006 23:03:20 +0000 (23:03 +0000)
committerTom Lane
Tue, 14 Mar 2006 23:03:20 +0000 (23:03 +0000)
just doesn't work with Bison 2.0 ... fix it ...

src/backend/parser/gram.y

index acaddb13651ade62caac4d33beccd92035aa34de..1eb951996332b1892a203fc398cc2232eda36dc6 100644 (file)
@@ -11,7 +11,7 @@
  *
  *
  * IDENTIFICATION
- *   $PostgreSQL: pgsql/src/backend/parser/gram.y,v 2.535 2006/03/14 22:48:20 tgl Exp $
+ *   $PostgreSQL: pgsql/src/backend/parser/gram.y,v 2.536 2006/03/14 23:03:20 tgl Exp $
  *
  * HISTORY
  *   AUTHOR            DATE            MAJOR EVENT
 
 /* Location tracking support --- simpler than bison's default */
 #define YYLLOC_DEFAULT(Current, Rhs, N) \
-   Current = Rhs[1];
+   do { \
+       if (N) \
+           (Current) = (Rhs)[1]; \
+       else \
+           (Current) = (Rhs)[0]; \
+   } while (0)
 
 extern List *parsetree;            /* final parse result is delivered here */