skvadrik / re2c

Lexer generator for C, C++, Go and Rust.

Home Page:https://re2c.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

make failure for re2c on centos7

tigerzhang15 opened this issue · comments

[root@localhost re2c-master]# make
  GEN      src/msg/help.cc
  GEN      src/parse/parser.cc
Reconfigure with --enable-parsers to regenerate src/parse/parser.cc
  GEN      src/parse/lex.cc
Reconfigure with --enable-lexers to regenerate src/parse/lex.cc
  GEN      src/msg/ver_to_vernum.cc
Reconfigure with --enable-lexers to regenerate src/msg/ver_to_vernum.cc
  GEN      src/parse/lex_conf.cc
Reconfigure with --enable-lexers to regenerate src/parse/lex_conf.cc
  GEN      src/options/parse_opts.cc
Reconfigure with --enable-lexers to regenerate src/options/parse_opts.cc
make  all-recursive
make[1]: Entering directory `/usr/local/src/re2c-master'
Making all in .
make[2]: Entering directory `/usr/local/src/re2c-master'
  CXX      src/main.o
In file included from ./src/dfa/tcmd.h:11:0,
                 from ./src/codegen/code.h:7,
                 from ./src/codegen/output.h:13,
                 from ./src/adfa/adfa.h:12,
                 from src/main.cc:10:
./src/util/containers.h: In instantiation of ‘class re2c::uniq_vector_t<re2c::AcceptTrans>’:
./src/adfa/adfa.h:95:32:   required from here
./src/util/containers.h:158:7: warning: base class ‘class std::vector<re2c::AcceptTrans, std::allocator<re2c::AcceptTrans> >’ has a non-virtual destructor [-Weffc++]
 class uniq_vector_t : public std::vector<T> {
       ^
In file included from src/main.cc:18:0:
./src/nfa/nfa.h:36:23: warning: ‘re2c::TnfaState::status’ is too small to hold all values of ‘enum class re2c::GorPass’ [enabled by default]
     GorPass status  : 2;  // GOR1: status (values 0, 1, 2)
                       ^
In file included from ./src/parse/input.h:16:0,
                 from src/main.cc:21:
../src/parse/parser.ypp:7:2: warning: extra ‘;’ [-Wpedantic]
In file included from src/main.cc:21:0:
./src/parse/input.h:53:7: warning: base class ‘struct re2c::LexerState’ has a non-virtual destructor [-Weffc++]
 class Input: private LexerState {
       ^
  CXX      src/codegen/helpers.o
  CXX      src/codegen/output.o
In file included from ./src/dfa/tcmd.h:11:0,
                 from ./src/codegen/code.h:7,
                 from ./src/codegen/output.h:13,
                 from ./src/adfa/adfa.h:12,
                 from src/codegen/output.cc:7:
./src/util/containers.h: In instantiation of ‘class re2c::uniq_vector_t<re2c::AcceptTrans>’:
./src/adfa/adfa.h:95:32:   required from here
./src/util/containers.h:158:7: warning: base class ‘class std::vector<re2c::AcceptTrans, std::allocator<re2c::AcceptTrans> >’ has a non-virtual destructor [-Weffc++]
 class uniq_vector_t : public std::vector<T> {
       ^
  CXX      src/codegen/pass1_analyze.o
In file included from ./src/dfa/tcmd.h:11:0,
                 from ./src/codegen/code.h:7,
                 from ./src/codegen/output.h:13,
                 from ./src/adfa/adfa.h:12,
                 from src/codegen/pass1_analyze.cc:4:
./src/util/containers.h: In instantiation of ‘class re2c::uniq_vector_t<re2c::AcceptTrans>’:
./src/adfa/adfa.h:95:32:   required from here
./src/util/containers.h:158:7: warning: base class ‘class std::vector<re2c::AcceptTrans, std::allocator<re2c::AcceptTrans> >’ has a non-virtual destructor [-Weffc++]
 class uniq_vector_t : public std::vector<T> {
       ^
In file included from src/codegen/pass1_analyze.cc:6:0:
./src/options/opt.h:239:8: warning: unused parameter ‘opt’ [-Wunused-parameter]
 struct opt_t {
        ^
src/codegen/pass1_analyze.cc: In function ‘void re2c::codegen_analyze(re2c::Output&)’:
src/codegen/pass1_analyze.cc:597:46: note: synthesized method ‘re2c::opt_t& re2c::opt_t::operator=(const re2c::opt_t&)’ first required here
             *const_cast<opt_t*>(bs[0]->opts) = *bs[1]->opts;
                                              ^
  CXX      src/codegen/pass2_generate.o
In file included from ./src/dfa/tcmd.h:11:0,
                 from ./src/codegen/code.h:7,
                 from ./src/codegen/output.h:13,
                 from ./src/adfa/adfa.h:12,
                 from src/codegen/pass2_generate.cc:10:
./src/util/containers.h: In instantiation of ‘class re2c::uniq_vector_t<re2c::AcceptTrans>’:
./src/adfa/adfa.h:95:32:   required from here
./src/util/containers.h:158:7: warning: base class ‘class std::vector<re2c::AcceptTrans, std::allocator<re2c::AcceptTrans> >’ has a non-virtual destructor [-Weffc++]
 class uniq_vector_t : public std::vector<T> {
       ^
  CXX      src/codegen/pass3_fixup.o
  CXX      src/codegen/pass4_render.o
  CXX      src/options/opt.o
In file included from ./src/parse/input.h:16:0,
                 from src/options/opt.cc:3:
../src/parse/parser.ypp:7:2: warning: extra ‘;’ [-Wpedantic]
In file included from src/options/opt.cc:3:0:
./src/parse/input.h:53:7: warning: base class ‘struct re2c::LexerState’ has a non-virtual destructor [-Weffc++]
 class Input: private LexerState {
       ^
  CXX      src/options/symtab.o
In file included from ./src/parse/input.h:16:0,
                 from src/options/symtab.cc:3:
../src/parse/parser.ypp:7:2: warning: extra ‘;’ [-Wpedantic]
In file included from src/options/symtab.cc:3:0:
./src/parse/input.h:53:7: warning: base class ‘struct re2c::LexerState’ has a non-virtual destructor [-Weffc++]
 class Input: private LexerState {
       ^
  CXX      src/nfa/re_to_nfa.o
In file included from src/nfa/re_to_nfa.cc:6:0:
./src/nfa/nfa.h:36:23: warning: ‘re2c::TnfaState::status’ is too small to hold all values of ‘enum class re2c::GorPass’ [enabled by default]
     GorPass status  : 2;  // GOR1: status (values 0, 1, 2)
                       ^
  CXX      src/adfa/adfa.o
In file included from ./src/dfa/tcmd.h:11:0,
                 from ./src/codegen/code.h:7,
                 from ./src/codegen/output.h:13,
                 from ./src/adfa/adfa.h:12,
                 from src/adfa/adfa.cc:9:
./src/util/containers.h: In instantiation of ‘class re2c::uniq_vector_t<re2c::AcceptTrans>’:
./src/adfa/adfa.h:95:32:   required from here
./src/util/containers.h:158:7: warning: base class ‘class std::vector<re2c::AcceptTrans, std::allocator<re2c::AcceptTrans> >’ has a non-virtual destructor [-Weffc++]
 class uniq_vector_t : public std::vector<T> {
       ^
  CXX      src/debug/dump_adfa.o
  CXX      src/debug/dump_cfg.o
  CXX      src/debug/dump_dfa.o
  CXX      src/debug/dump_dfa_tree.o
  CXX      src/debug/dump_interf.o
  CXX      src/debug/dump_nfa.o
  CXX      src/cfg/cfg.o
  CXX      src/cfg/compact.o
  CXX      src/cfg/dce.o
  CXX      src/cfg/freeze.o
  CXX      src/cfg/interfere.o
  CXX      src/cfg/liveanal.o
  CXX      src/cfg/normalize.o
  CXX      src/cfg/optimize.o
  CXX      src/cfg/rename.o
  CXX      src/cfg/varalloc.o
  CXX      src/dfa/closure.o
In file included from ./src/dfa/determinization.h:12:0,
                 from src/dfa/closure.cc:8:
./src/nfa/nfa.h:36:23: warning: ‘re2c::TnfaState::status’ is too small to hold all values of ‘enum class re2c::GorPass’ [enabled by default]
     GorPass status  : 2;  // GOR1: status (values 0, 1, 2)
                       ^
In file included from src/dfa/closure.cc:11:0:
./src/dfa/closure_posix.h: In function ‘void re2c::closure_posix_gor1(ctx_t&)’:
./src/dfa/closure_posix.h:68:27: error: no match for ‘operator==’ (operand types are ‘unsigned char:2’ and ‘re2c::GorPass’)
             if (q->status == GorPass::LINEAR) {
                           ^
./src/dfa/closure_posix.h: In function ‘bool re2c::relax_gor1(ctx_t&, const typename ctx_t::conf_t&)’:
./src/dfa/closure_posix.h:157:19: error: no match for ‘operator==’ (operand types are ‘unsigned char:2’ and ‘re2c::GorPass’)
     if (q->status == GorPass::TOPSORT) {
                   ^
./src/dfa/closure_posix.h:170:19: error: no match for ‘operator==’ (operand types are ‘unsigned char:2’ and ‘re2c::GorPass’)
     if (q->status == GorPass::NOPASS) {
                   ^
./src/dfa/closure_posix.h: In function ‘bool re2c::relax_gor1(ctx_t&, const typename ctx_t::conf_t&) [with ctx_t = re2c::determ_context_t<re2c::phistory_t>; typename ctx_t::conf_t = re2c::clos_t]’:
./src/dfa/closure_posix.h:178:1: error: control reaches end of non-void function [-Werror=return-type]
 }
 ^
cc1plus: some warnings being treated as errors
make[2]: *** [src/dfa/closure.o] Error 1
make[2]: Leaving directory `/usr/local/src/re2c-master'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/usr/local/src/re2c-master'
make: *** [all] Error 2

This is my compiler information

[root@localhost re2c-master]# gcc --version
gcc (GCC) 9.3.1 20200408 (Red Hat 9.3.1-2)
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

[root@localhost re2c-master]#

Thanks for reporting! Please retry with the fix: d7c6971.

Thanks for reporting! Please retry with the fix: d7c6971.

I tried to re-compile and install on centos7, and the problem has been fixed. Thank you very much for your help

Closing, as the error is fixed now.