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

Cannot build master with GCC 9 #390

Closed
lemenkov opened this issue Mar 27, 2019 · 2 comments
Closed

Cannot build master with GCC 9 #390

lemenkov opened this issue Mar 27, 2019 · 2 comments

Comments

@lemenkov
Copy link
Member

lemenkov commented Mar 27, 2019

Hello All!
Now I'm stuck :). I've got a very recent GCC 9.0.1 on my Fedora 30 and cannot build SIPp anymore. It fails with a very cryptic message:

g++ -DHAVE_CONFIG_H -DUSE_OPENSSL -DPCAPPLAY -DRTP_STREAM -DUSE_SCTP  -DHAVE_EPOLL -I. -I./include   -D__LINUX -I./include -Wall -pedantic  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -c -o src/sipp-sipp.o `test -f 'src/sipp.cpp' || echo './'`src/sipp.cpp
In file included from ./include/strings.hpp:24,
                 from ./include/sipp.hpp:484,
                 from src/sipp.cpp:41:
/usr/include/c++/9/cstddef:52:8: error: expected unqualified-id before string constant
   52 | extern "C++"
      |        ^~~~~
make[1]: *** [Makefile:1768: src/sipp-sipp.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory '/home/petro/rpmbuild/BUILD/sipp-3.5.2'
make: *** [Makefile:830: all] Error 2
error: Bad exit status from /var/tmp/rpm-tmp.Y5CFt4 (%build)

That's exactly where I'm stuck now. This is how my /usr/include/c++/9/cstddef looks like:

And I tend to think that this issue is related to this commit gcc-mirror/gcc@038feca.

@lemenkov lemenkov changed the title Cannob build master with GCC 9 Cannot build master with GCC 9 Mar 27, 2019
@wdoekes
Copy link
Member

wdoekes commented Mar 27, 2019

g++ -E and then check the surroundings of that extern "C++"?

@jwakely
Copy link

jwakely commented Mar 27, 2019

And I tend to think that this issue is related to this commit gcc-mirror/gcc@038feca.

The problem is this completely ridiculous code in sipp:

#ifdef GLOBALS_FULL_DEFINITION
#define extern
#define _DEFVAL(value) = value
#else
#define _DEFVAL(value)
#endif

This is undefined, and just really bad.

You cannot redefine what extern means, and you also cannot defined macros with reserved names like _DEFVAL (or like the include guard __SIPP_LOGGER_H__).

Try doing it like this instead:

#ifdef GLOBALS_FULL_DEFINITION
#define MAYBE_EXTERN
#define DEFVAL(value) = value
#else
#define MAYBE_EXTERN extern
#define DEFVAL(value)
#endif

And then use MAYBE_EXTERN and DEFVAL (not _DEFVAL) on the declarations in the rest of the file.

lemenkov pushed a commit to lemenkov/sipp that referenced this issue Dec 16, 2019
lemenkov pushed a commit to lemenkov/sipp that referenced this issue Dec 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants