GHPS / txt2pho

A TTS frontend for the German inventories of the MBROLA project (Official Repository)
GNU Affero General Public License v3.0
6 stars 1 forks source link

Bug: Build fails with gcc11 #2

Closed lgbaldoni closed 3 years ago

lgbaldoni commented 3 years ago

Building txt2pho 0.96 on openSUSE Tumbleweed.

/usr/bin/g++ -Isrc -I./src -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -g -DSTATISTICS -DBORDERPROS -DNEWTREE -DNO_FILES -DNOWINMOD -DUNIX -DPHONDURNET -DLOWBORDERTONE -DIPHONDURNET -DLINUX -DGCC28  -o obj/hposttra.o -c src/hposttra.cc
In file included from src/xscript.h:20,
                 from src/hposttra.cc:12:
src/debug.h:46: warning: ignoring '#pragma option ' [-Wunknown-pragmas]
   46 |     #pragma option -vi+
      | 
In file included from src/ptra.h:24,
                 from src/lexicon.h:26,
                 from src/xscript.h:25,
                 from src/hposttra.cc:12:
/usr/include/c++/11/cmath: In function '_Tp std::__hypot3(_Tp, _Tp, _Tp)':
src/list.h:16:16: error: expected unqualified-id before '(' token
   16 | #define abs(a) ((a)>0?(a):-(a))

Full build log here.

GHPS commented 3 years ago

Thanks for the bug report!

Since gcc11 has just been released, this problem is something to keep an eye on.

If you, however, want to get txt2pho working as quick as possible I suggest using an earlier version of gcc, e.g. gcc8.

lgbaldoni commented 3 years ago

A friend recommended commenting out this line and now the thing builds. What do you think?

GHPS commented 3 years ago

A friend recommended commenting out this line and now the thing builds. What do you think?

Great - these are good news. Thanks for the testing...

I will do some further testing and check in this patch with master in the next days.

GHPS commented 3 years ago

I just fixed the issues with GCC 11.1 - besides the superfluous abs() function there was also a problem with an uninitialized string in the preprocessor. Must have there for ages - now it's gone...

All changes are already merged into master (https://github.com/GHPS/txt2pho/commit/2d1282c31ff3c76d0445dabd343e7a831368bddf)

Thanks for your help.