瀏覽代碼

Merge pull request #12638 from dcamper/hpcc-22107-yystype-warning

HPCC-22107 Remove compiler warning from grammar

Reviewed-by: Gavin Halliday <ghalliday@hpccsystems.com>
Gavin Halliday 6 年之前
父節點
當前提交
b722d0f213
共有 2 個文件被更改,包括 9 次插入3 次删除
  1. 4 0
      ecl/hql/hqlgram.y
  2. 5 3
      ecl/hql/hqllex.l

+ 4 - 0
ecl/hql/hqlgram.y

@@ -35,6 +35,10 @@
 //The following allows the stack of shifted states to expand.  It indicates memcpy of the data is valid.
 #define YYSTYPE_IS_TRIVIAL 1
 
+// Workaround Bison unconditionally #defining YYSTYPE as ECLYYSTYPE, which generates warnings when we use attribute instead
+#undef YYSTYPE
+#define YYSTYPE attribute
+
 #include "platform.h"
 #include <stdio.h>
 #include <stdlib.h>

+ 5 - 3
ecl/hql/hqllex.l

@@ -32,11 +32,13 @@
 #include "hqlgram.h"
 
 #if !defined(BISON_MAJOR_VER) || BISON_MAJOR_VER == 2
-#define YY_DECL int HqlLex::doyyFlex(YYSTYPE & returnToken, yyscan_t yyscanner, HqlLex * lexer, bool lookup, const short * activeState)
+#define YYSTYPE attribute
 #else
-#define YY_DECL int HqlLex::doyyFlex(ECLYYSTYPE & returnToken, yyscan_t yyscanner, HqlLex * lexer, bool lookup, const short * activeState)
+#define ECLYYSTYPE attribute
 #endif
 
+#define YY_DECL int HqlLex::doyyFlex(attribute & returnToken, yyscan_t yyscanner, HqlLex * lexer, bool lookup, const short * activeState)
+
 #define register
 
 //#define DEBUG_TOKEN 
@@ -70,7 +72,7 @@ extern void hex2str(char * target, const char * digits, unsigned len);
 #define RETURNHARD(sym) \
         setupdatepos; return sym;
 
-int HqlLex::lookupIdentifierToken(YYSTYPE & returnToken, HqlLex * lexer, bool lookup, const short * activeState, const char * tokenText)
+int HqlLex::lookupIdentifierToken(attribute & returnToken, HqlLex * lexer, bool lookup, const short * activeState, const char * tokenText)
 {
     if ((tokenText[0] == '$') && tokenText[1]==0)
         return '$';