With experimentals with gcc 7.1.0, i have one issue left, transcoding for vusolo2 etc.
With gcc 7.1.0 'throw()' is deprecated.
In file included from ../../git/src/acceptsocket.cpp:4:0: | ../../git/src/acceptsocket.h:21:30: error: dynamic exception specifications are deprecated in C++11 [-Werror=deprecated] | AcceptSocket(string port) throw(trap); | ^~~~~
Replace 'throw' with 'noexcept(false)' in header files is no problem, but in cpp files, e.g. acceptsocket.cpp is an other story.
if((fd = socket(AF_INET6, SOCK_STREAM | SOCK_CLOEXEC, 0)) < 0) throw(trap("AcceptSocket: cannot create accept socket")); noexcept() is a bool function, so replacing doesn't work. The only way i figure out is to get rid of throw() So the code will be. if((fd = socket(AF_INET6, SOCK_STREAM | SOCK_CLOEXEC, 0)) < 0) trap("AcceptSocket: cannot create accept socket");
That makes gcc7 happy and streamproxy does build flawless(after applying that patch 1001 times in code)... And exception handling is shot to the ground.
But the question is, does it work without throw() ???
Better to restore exception handling..But how?
As far as i do understand well, noexcept() doesn't call std::unexpected.
Dreambox don't have transcoding, so i can't test it myself.
But after succesfull build vusolo2 with gcc7 i'm just curious.I solved kernel,enigma2 and plugins, and streamproxy is the last one on which i'm stuck.
Now i want to make it to the end.
If anyone knows how to restore exception handling with noexcept(), or can confirm this will won't work anyway or thinks streamproxy can live without it..That would be Nice.
An other small detail:
gcc7 don't like fall-through is switch/case (under some circumstances).
switch(c) { case(2): { ix = timestring.find(':'); part = timestring.substr(0, ix); seconds += strtoul(part.c_str(), 0, 10) * 60 * 60; timestring.erase(0, ix + 1); // fall through } case(1): { ix = timestring.find(':'); part = timestring.substr(0, ix); seconds += strtoul(part.c_str(), 0, 10) * 60; timestring.erase(0, ix + 1); // fall through } case(0): { ix = timestring.find(':'); part = timestring.substr(0, ix); seconds += strtoul(part.c_str(), 0, 10); break; } default: { throw(trap("TimeOffset: invalid timestring, to many colons")); } } I get error: ../../git/src/time_offset.cpp: In constructor 'TimeOffset::TimeOffset(std::__cxx11::string)': | ../../git/src/time_offset.cpp:32:20: error: this statement may fall through [-Werror=implicit-fallthrough=] | timestring.erase(0, ix + 1); | ~~~~~~~~~~~~~~~~^~~~~~~~~~~ | ../../git/src/time_offset.cpp:37:3: note: here | case(1): | ^~~~
I had to rework the case switch construction in:
switch(c) { case(2): { ix = timestring.find(':'); part = timestring.substr(0, ix); seconds += strtoul(part.c_str(), 0, 10) * 60 * 60; timestring.erase(0, ix + 1); ix = timestring.find(':'); part = timestring.substr(0, ix); seconds += strtoul(part.c_str(), 0, 10) * 60; timestring.erase(0, ix + 1); ix = timestring.find(':'); part = timestring.substr(0, ix); seconds += strtoul(part.c_str(), 0, 10); break; } case(1): { ix = timestring.find(':'); part = timestring.substr(0, ix); seconds += strtoul(part.c_str(), 0, 10) * 60; timestring.erase(0, ix + 1); ix = timestring.find(':'); part = timestring.substr(0, ix); seconds += strtoul(part.c_str(), 0, 10); break; } case(0): { ix = timestring.find(':'); part = timestring.substr(0, ix); seconds += strtoul(part.c_str(), 0, 10); break; }
That increase the code a little bit but anyway..That's a detail