skvadrik / re2c

Lexer generator for C, C++, Go and Rust.
https://re2c.org
Other
1.06k stars 169 forks source link

Test for C++11 compiler at configure time #455

Closed ryandesign closed 1 year ago

ryandesign commented 1 year ago

I understand that the 3.1 release requires a C++11 compiler. The build fails with a pre-C++11 compiler like g++-4.2.1 with errors such as:

../src/msg/ver_to_vernum.re:29: error: ‘constexpr’ does not name a type

The build process should have printed an error during the configure phase that clearly stated that the compiler did not support C++11 and that this was required, rather than continuing and trying to build and failing with an error that is more confusing to users.

skvadrik commented 1 year ago

Out of curiosity, why is the old compiler version g++-4.2.1 used?

skvadrik commented 1 year ago

Fixed in https://github.com/skvadrik/re2c/commit/96104a652622c63ca2cc0b1d2b1d3dad8c34aae6 and https://github.com/skvadrik/re2c/commit/59c56044b9de7a01c04e941f4c6c55238764d873. Please reopen if it doesn't work for you.

ryandesign commented 1 year ago

Fixed

Thanks!

Out of curiosity, why is the old compiler version g++-4.2.1 used?

The user who reported this problem uses a PowerPC Mac. Mac OS X 10.5.8 is the newest version available for PowerPC. Xcode 3.1.4 is the newest version available for that OS. gcc 4.2.1 is the newest compiler included in that version of Xcode. MacPorts by default uses a compiler from Xcode unless told to do otherwise. When the re2c 3.1 update was committed to MacPorts we had not realized that it now required C++11 so we had not told MacPorts to select a C++11-compatible compiler (but now we have).

skvadrik commented 1 year ago

Oh, good! Thanks for the detailed explanation.