I can reproduce the problem on my (Debian GNU/Linux) system by trying to compile that file using clang++7 with option --std=c++98.
Maybe this workaround could work for you: Explicitly set the standard for the compiler during configure, e.g. using ./configure CXX="g++ --std=c++11". But I'm not familiar with MacOS.
Philipp
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
[r11104] probably fixes this problem. configure now automatically tries to find the needed compiler flags to select the C++11 dialect if it is not the default.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Please do not do this! SDCC needs C11 compiler, but ucsim does not! It is available as a separate package, can be downloaded from my site and there are users who get it from there. It can be compiled with as old compiler as gcc-2.95, and I would not like to break it.
Please do not extend C11 restriction to all parts of SDCC.
Daniel
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
ucsim currently needs C++11. The bug report is about it failing to build with a compiler not supporting C++11, so Erik just made the build system choose a suitable compiler.
Nicolas contributed the part of ucsim that needs C++11. Should we ask him to rewrite using ancient C++98?
Philipp
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Daniel,
I have reverted my changes and will try to find a solution outside of the sim/ucsim subtree.
Philipp,
The cf-x86-macosx build machine uses Apple LLVM version 9.0.0 (clang-900.0.39.2), which does support C++11, but also behaves similarly to the reporter's 7.3.0 and does not default to it.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Which compiler and version did you use to compile SDCC (what is the output of g++ --version on your system)?
Philipp
“gcc --version” shows:
“g++ --version” shows:
SDCC requires a compiler that supports at least C++11 (see https://sourceforge.net/p/sdcc/wiki/Language%20dialects%20used%20in%20SDCC/ for details). Your compüiler seems to be clang 7 (which normally supports C++11), but somehow configured into C++98-mode.
I can reproduce the problem on my (Debian GNU/Linux) system by trying to compile that file using clang++7 with option --std=c++98.
Maybe this workaround could work for you: Explicitly set the standard for the compiler during configure, e.g. using ./configure CXX="g++ --std=c++11". But I'm not familiar with MacOS.
Philipp
[r11104] probably fixes this problem. configure now automatically tries to find the needed compiler flags to select the C++11 dialect if it is not the default.
Dear Erik,
Please do not do this! SDCC needs C11 compiler, but ucsim does not! It is available as a separate package, can be downloaded from my site and there are users who get it from there. It can be compiled with as old compiler as gcc-2.95, and I would not like to break it.
Please do not extend C11 restriction to all parts of SDCC.
Daniel
ucsim currently needs C++11. The bug report is about it failing to build with a compiler not supporting C++11, so Erik just made the build system choose a suitable compiler.
Nicolas contributed the part of ucsim that needs C++11. Should we ask him to rewrite using ancient C++98?
Philipp
Dear Philipp,
Thank you making this clear. I have not tested pdk simulator yet...
It would be nice, but it has very little importance. If he can not, I will do it later. Currently I'm working on features requested by other users.
Daniel
Daniel,
I have reverted my changes and will try to find a solution outside of the sim/ucsim subtree.
Philipp,
The cf-x86-macosx build machine uses Apple LLVM version 9.0.0 (clang-900.0.39.2), which does support C++11, but also behaves similarly to the reporter's 7.3.0 and does not default to it.
Dear Erik,
The new pdk simulator introduced this C++11 dependency to the ucsim, so your fix was indeed correct! I have re-committed it today.
I'll try to resolve it later.
Daniel
Hi,
[r11118] removes need of C++11 from ucsim. So, I removed the C++11 check from configure.
Daniel
Though I wonder why you changed bool to int. After all, bool has been part of C++ since the very first standard in 1998.
Philipp
P.S.: If desired, I think the old flag::z syntax could be achieved by wrapping an enum in a namespace called flag? But I'm not an expert on C++.
Last edit: Philipp Klaus Krause 2019-03-18
[r11118] fixes the problem for me, thanks.