Re: [PATCH 00/14] glr2.cc: fix linking conflicts

Hans Ã…berg <[email protected]> Mon, 13 Sep 2021 18:00:28 +0200
Newsgroups gmane.comp.parsers.bison.patches
Message-ID <[email protected]>
> On 13 Sep 2021, at 16:19, Thomas Shields =
<[email protected]> wrote:
>=20
> Thanks for the note.

:-)

> I should have mentioned that the version of Ox I was reporting against =
is 1.10 (under development, I=E2=80=99m the only developer).

Great!

> I=E2=80=99m in the process of =E2=80=9Cupgrading=E2=80=9D the Ox =
source from C to C++, allowing me to simplify the Ox implementation.

I am primarily programming in C++, so this sounds great! =E2=80=94Also =
GCC switched to C++.

> Akim=E2=80=99s patches fix some problems I reported when I switched =
the Ox parser specs to use the Bison C++ skeleton, and also switched =
from the legacy =E2=80=98%union=E2=80=99 to Bison=E2=80=99s =E2=80=98%defi=
ne api.value.type variant=E2=80=99 directive.

The skeleton system using M4 is clearly superior to what was before in =
Bison, so this sounds good, too.

> Once I get through the initial cleanup effort (replacing malloc, =
calloc, realloc, free, strdup, & strndup; converting to use C++ library =
containers; and rewriting the output manager) and get Ox through the =
portability tests (on Linux, Solaris & Windows), I=E2=80=99ll release =
1.10. It will probably take me another week to get through this.

I ended up to using C++20, because C++17 has std::optional and C++20 =
operator<=3D>, but C++14 is the current default of GCC I think.

Also, I use GCC and Clang of MacPorts, which are quite up-to-date. In =
/usr/local/bin/, I set soft links from gcc to the real gcc, clang to the =
real clang, and then cc is what is provided by Apple. When building. I =
have to set flags, say for g++11:
../mli-root/configure CXX=3D/opt/local/bin/g++-mp-11 CXXFLAGS=3D-g =
CC=3D/opt/local/bin/gcc-mp-11 CPPFLAGS=3D"-g -I /usr/local/include" =
LDFLAGS=3D"-L /usr/local/lib"

The two last arguments CPPFLAGS and LDFLAGS are for the compiler to see =
packages installed by hand in /usr/local.