Closed justinc1 closed 7 years ago
Changing :
index 6a79af1..1c0d7f3 100644
--- a/iperf/Makefile
+++ b/iperf/Makefile
@@ -17,7 +17,7 @@ iperf: $(iperfv)/src/iperf
$(iperfv)/src/iperf: $(tarball)
tar xzf $^
patch -p0 < so.patch
- cd $(iperfv) && CFLAGS='-fPIC -g' CXXFLAGS='-fPIC -g' ./configure
+ cd $(iperfv) && CC='gcc' CXX='g++' CFLAGS='-fPIC -g' CXXFLAGS='-fPIC -g' ./configure
+$(MAKE) -C $(iperfv)
$(tarball):
didn't help, as many .c files then fail to compile.
It helps to comment out #define bool int
in config.h.
Or to use iperf-2.0.10 from http://sourceforge.net/projects/iperf2. It is a sort of maintenance fork, with new features, and emphasis on compatibility with orig iperf 2 client/servers.
I can reproduce this problem.
The "#define bool int" is a really bad thing to do in C++ because "bool" is a different type. The problem is that iperf's configure (see configure.ac and output in config.log) checks "bool" in a run of "gcc" without parameters - and that used to default to C89 and not C99. This is silly - to check "bool" in C and then compile with c++...
Maybe by adding "-std=c99" to CFLAGS when running configure we can fix that. I'll check.
What a mess... The code doesn't compile with -std=c99. I'll try to hack config.h and see if helps.
try to hack config.h
If you mean to comment out '#define bool int' - code compiled, and both server and client worked afterwards.
:D :D :D for
There is simply no reason for this test - none of the C files actually use "bool"!
I didn't notice that.
Yes, instead of hacking config.h after it was created, I wanted to see if I could cause it not to create the bad definition. And it's actually easy - just don't ask autoconf to do this bool test... It's not needed in the first place, the code doesn't even use "bool", so why did this test exist in the first place?
By the way, I'm worried that -std=c99 didn't work - it means will have problems in the future when compilers start to default to that. Maybe someone will fix the iperf code by then...
On fedora 25 with gcc 6.3:
Problem comes from