Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compile error "expected unqualified-id before numeric constant" #1329

Closed
veripoolbot opened this issue Aug 14, 2018 · 9 comments
Closed

Compile error "expected unqualified-id before numeric constant" #1329

veripoolbot opened this issue Aug 14, 2018 · 9 comments
Labels
area: configure/compiling Issue involves configuring or compilating Verilator itself resolution: no fix needed Closed; no fix required (not a bug)

Comments

@veripoolbot
Copy link
Contributor


Author Name: Shawn Boshart
Original Redmine Issue: 1329 from https://www.veripool.org


./configure runs without issue, but make fails with the below message. I have tried newer versions of flex/bison, but cannot figure how to solve.

sccj017209:12:10pm:/<4>tools/verilator/verilator-3.853> make
------------------------------------------------------------
making verilator in src                                     
make[1]: Entering directory `/nfs/sc/disks/axx_0022/tools/verilator/verilator-3.853/src'
cd obj_dbg && make -j 1  TGT=../../verilator_bin_dbg VL_DEBUG=1 -f ../Makefile_obj serial
make[2]: Entering directory `/nfs/sc/disks/axx_0022/tools/verilator/verilator-3.853/src/obj_dbg'
make[2]: Nothing to be done for `serial'.                                                       
make[2]: Leaving directory `/nfs/sc/disks/axx_0022/tools/verilator/verilator-3.853/src/obj_dbg' 
cd obj_dbg && make       TGT=../../verilator_bin_dbg VL_DEBUG=1 -f ../Makefile_obj              
make[2]: Entering directory `/nfs/sc/disks/axx_0022/tools/verilator/verilator-3.853/src/obj_dbg'
       Compile flags:  g++ -I/nfs/sc/disks/axx_0022/tools/verilator/3.853/include -MMD -I. -I.. -I.. -I../../include -DYYDEBUG -ggdb -DVL_DEBUG -MP -DDEFENV_SYSTEMC="" -DDEFENV_SYSTEMC_ARCH="" -DDEFENV_SYSTEMC_INCLUDE="" -DDEFENV_SYSTEMC_LIBDIR="" -DDEFENV_SYSTEMPERL="" -DDEFENV_SYSTEMPERL_INCLUDE="" -DDEFENV_VERILATOR_ROOT="/nfs/sc/disks/axx_0022/tools/verilator/verilator-3.853" 
g++ -I/nfs/sc/disks/axx_0022/tools/verilator/3.853/include -MMD -I. -I.. -I.. -I../../include -DYYDEBUG          -ggdb -DVL_DEBUG -MP  -DDEFENV_SYSTEMC=\"\" -DDEFENV_SYSTEMC_ARCH=\"\" -DDEFENV_SYSTEMC_INCLUDE=\"\" -DDEFENV_SYSTEMC_LIBDIR=\"\" -DDEFENV_SYSTEMPERL=\"\" -DDEFENV_SYSTEMPERL_INCLUDE=\"\" -DDEFENV_VERILATOR_ROOT=\"/nfs/sc/disks/axx_0022/tools/verilator/verilator-3.853\" -Wno-unused -c ../V3ParseLex.cpp                                                                                                                                                             
In file included from V3Lexer_pregen.yy.cpp:245:0,                                                                                                                                             
                  from ../V3ParseLex.cpp:37:                                                                                                                                                    
/usr/include/FlexLexer.h:130:14: error: expected unqualified-id before numeric constant                                                                                                        
In file included from ../V3ParseLex.cpp:37:0:                                                                                                                                                  
V3Lexer_pregen.yy.cpp: In member function ‘virtual int V3LexerBase::yylex()’:                                                                                                                  
V3Lexer_pregen.yy.cpp:3456:10: error: ‘yy_current_buffer’ was not declared in this scope                                                                                                       
In file included from ../V3ParseLex.cpp:37:0:                                                                                                                                                  
V3Lexer_pregen.yy.cpp:7276:8: error: ‘yy_current_buffer’ was not declared in this scope                                                                                                        
V3Lexer_pregen.yy.cpp:7299:23: error: ‘yy_current_buffer’ was not declared in this scope                                                                                                       
V3Lexer_pregen.yy.cpp: In constructor ‘V3LexerBase::V3LexerBase(std::istream*, std::ostream*)’:                                                                                                
V3Lexer_pregen.yy.cpp:7416:2: error: ‘yy_current_buffer’ was not declared in this scope                                                                                                        
V3Lexer_pregen.yy.cpp: In destructor ‘virtual V3LexerBase::~V3LexerBase()’:                                                                                                                    
V3Lexer_pregen.yy.cpp:7428:20: error: ‘yy_current_buffer’ was not declared in this scope                                                                                                       
V3Lexer_pregen.yy.cpp: In member function ‘virtual void V3LexerBase::switch_streams(std::istream*, std::ostream*)’:
V3Lexer_pregen.yy.cpp:7435:21: error: ‘yy_current_buffer’ was not declared in this scope
V3Lexer_pregen.yy.cpp: In member function ‘int V3LexerBase::yy_get_next_buffer()’:
V3Lexer_pregen.yy.cpp:7488:24: error: ‘yy_current_buffer’ was not declared in this scope
V3Lexer_pregen.yy.cpp: In member function ‘void V3LexerBase::yyunput(int, char*)’:
V3Lexer_pregen.yy.cpp:7683:15: error: ‘yy_current_buffer’ was not declared in this scope
V3Lexer_pregen.yy.cpp: In member function ‘int V3LexerBase::yyinput()’:
V3Lexer_pregen.yy.cpp:7725:22: error: ‘yy_current_buffer’ was not declared in this scope
V3Lexer_pregen.yy.cpp: In member function ‘virtual void V3LexerBase::yyrestart(std::istream*)’:
V3Lexer_pregen.yy.cpp:7784:9: error: ‘yy_current_buffer’ was not declared in this scope
V3Lexer_pregen.yy.cpp:7787:18: error: ‘yy_current_buffer’ was not declared in this scope
V3Lexer_pregen.yy.cpp: In member function ‘virtual void V3LexerBase::yy_switch_to_buffer(YY_BUFFER_STATE)’:
V3Lexer_pregen.yy.cpp:7794:7: error: ‘yy_current_buffer’ was not declared in this scope
V3Lexer_pregen.yy.cpp:7797:7: error: ‘yy_current_buffer’ was not declared in this scope
V3Lexer_pregen.yy.cpp:7805:2: error: ‘yy_current_buffer’ was not declared in this scope
V3Lexer_pregen.yy.cpp: In member function ‘void V3LexerBase::yy_load_buffer_state()’:
V3Lexer_pregen.yy.cpp:7819:15: error: ‘yy_current_buffer’ was not declared in this scope
V3Lexer_pregen.yy.cpp: In member function ‘virtual void V3LexerBase::yy_delete_buffer(YY_BUFFER_STATE)’:
V3Lexer_pregen.yy.cpp:7856:12: error: ‘yy_current_buffer’ was not declared in this scope
V3Lexer_pregen.yy.cpp: In member function ‘void V3LexerBase::yy_flush_buffer(YY_BUFFER_STATE)’:
V3Lexer_pregen.yy.cpp:7898:12: error: ‘yy_current_buffer’ was not declared in this scope
make[2]: *** [V3ParseLex.o] Error 1
make[2]: Leaving directory `/nfs/sc/disks/axx_0022/tools/verilator/verilator-3.853/src/obj_dbg'
make[1]: *** [../verilator_bin_dbg] Error 2
make[1]: Leaving directory `/nfs/sc/disks/axx_0022/tools/verilator/verilator-3.853/src'
make: *** [verilator_exe] Error 2

@veripoolbot
Copy link
Contributor Author


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2018-08-19T06:31:20Z


Sorry you are having problems.

What OS version?

What flex version?

What is the code around the lines the compiler is complaining about?

@veripoolbot
Copy link
Contributor Author


Original Redmine Comment
Author Name: Shawn Boshart
Original Date: 2018-08-27T17:16:01Z


OS:
sccj017209:10:04am:sdg74_MDWA0P10_SETUP~/axx_0022/sboshart/MDWA0> uname -a
Linux sccj017209 3.0.101-108.13.1.14249.0.PTF-default #1 SMP Thu Nov 30 18:45:29 UTC 2017 (ae6bb13) x86_64 x86_64 x86_64 GNU/Linux

FLEX:
sccj017209:10:10am:/<4>tools/verilator/verilator-3.853> flex -V
flex 2.6.4

What is the code around the lines the compiler is complaining about?
In file included from V3Lexer_pregen.yy.cpp:245:0,
from ../V3ParseLex.cpp:37:
/usr/include/FlexLexer.h:130:14: error: expected unqualified-id before numeric constant
In file included from ../V3ParseLex.cpp:37:0:

I think this is the line it is complaining about:
virtual int yywrap();

@veripoolbot
Copy link
Contributor Author


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2018-08-27T22:14:28Z


What distribution, e.g. Ubuntu 18.04, etc. (uname is the kernel version which doesn't say the distro.)

@veripoolbot
Copy link
Contributor Author


Original Redmine Comment
Author Name: Shawn Boshart
Original Date: 2018-08-27T23:24:38Z


Does this help?

sccj017209:4:22pm:/tmp/sboshart> rpm -qi glibc
Name        : glibc                        Relocations: (not relocatable)
Version     : 2.11.3                            Vendor: SUSE LINUX Products GmbH, Nuernberg, Germany
Release     : 17.109.1                      Build Date: Tue 06 Jun 2017 02:13:05 PM PDT
Install Date: Wed 11 Apr 2018 12:13:30 PM PDT      Build Host: sheep25
Group       : System/Libraries              Source RPM: glibc-2.11.3-17.109.1.src.rpm
Size        : 5554557                          License: BSD 3-Clause; GPL v2 or later; LGPL v2.1 or later
Signature   : RSA/8, Tue 06 Jun 2017 02:15:42 PM PDT, Key ID e3a5c360307e3d54
Packager    : https://www.suse.com/
URL         : http://www.gnu.org/software/libc/libc.html
Summary     : Standard Shared Libraries (from the GNU C Library)
Description :
The GNU C Library provides the most important standard libraries used
by nearly all programs: the standard C library, the standard math
library, and the POSIX thread library. A system is not functional
without these libraries.
Distribution: SUSE Linux Enterprise 11

@veripoolbot
Copy link
Contributor Author


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2018-08-27T23:36:03Z


You must in a big company to use an almost 10 year old distribution ;) Do they know that SuSE 11 general supports ends in a few months?

Anyhow I don't have a license so you'll need to debug yourself, if you're not sure how to do this ask someone in your organization that knows C++. Look at the sources around line 140 of /usr/include/FlexLexer.h:13, and also at V3Lexer_pregen.yy.cpp around line 3456.

@veripoolbot
Copy link
Contributor Author


Original Redmine Comment
Author Name: S Bagchi
Original Date: 2018-08-28T18:55:12Z


This make error is also seen with the following version of Linux:
Red Hat Enterprise Linux Server release 6.9 (Santiago)

@veripoolbot
Copy link
Contributor Author


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2018-08-29T00:08:25Z


Note on a hunch I tried using SEL 6.9 which is generally the same as RHEL 6.9, and it worked without issues, so you're still stuck to debug this locally, sorry.

@veripoolbot
Copy link
Contributor Author


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2018-10-05T00:58:22Z


Did you have any luck debugging this, or working around it?

@veripoolbot
Copy link
Contributor Author


Original Redmine Comment
Author Name: Shawn Boshart
Original Date: 2018-10-05T01:26:50Z


Please close. I copied a Linux redhat build over to Suse and it worked.

@veripoolbot veripoolbot added area: configure/compiling Issue involves configuring or compilating Verilator itself resolution: nofixneeded resolution: no fix needed Closed; no fix required (not a bug) and removed resolution: nofixneeded labels Dec 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: configure/compiling Issue involves configuring or compilating Verilator itself resolution: no fix needed Closed; no fix required (not a bug)
Projects
None yet
Development

No branches or pull requests

1 participant