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

Makefile for c++ produces error on make for g++ version 7.5 #312

Closed
meemsbror opened this issue Nov 5, 2020 · 1 comment
Closed

Makefile for c++ produces error on make for g++ version 7.5 #312

meemsbror opened this issue Nov 5, 2020 · 1 comment
Assignees
Milestone

Comments

@meemsbror
Copy link
Contributor

When running

bnfc --cpp -m -o sum-cpp Sum.cf &&  make -C sum-cpp  &&  echo "1 + 2 + 3" | sum-cpp/TestSum

As per the example in the README.md i get the following error

make: Entering directory '/sum-cpp'
g++ -g --ansi -W -Wall -Wno-unused-parameter -Wno-unused-function -Wno-unneeded-internal-declaration -c Test.C
Test.C:50:3: warning: identifier ‘nullptr’ is a keyword in C++11 [-Wc++11-compat]
   Exp *parse_tree = nullptr;
   ^~~
Test.C: In function ‘int main(int, char**)’:
Test.C:50:21: error: ‘nullptr’ was not declared in this scope
   Exp *parse_tree = nullptr;
                     ^~~~~~~
At global scope:
cc1plus: warning: unrecognized command line option ‘-Wno-unneeded-internal-declaration’
Makefile:48: recipe for target 'Test.o' failed
make: *** [Test.o] Error 1
make: Leaving directory '/sum-cpp'

when running g++ version 7.5.

This was circumvented by manually editing the makefile either adding the option

-std=gnu++0x

or

-std=c++11

to CCFLAGS

@andreasabel
Copy link
Member

Thanks for the report!
This is #310 which is fixed on the development version. Please install from the master branch to get this fix: https://github.com/BNFC/bnfc#installing-the-development-version

@andreasabel andreasabel added this to the 2.9 milestone Nov 6, 2020
@andreasabel andreasabel self-assigned this Nov 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants