mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2026-06-15 08:17:05 +00:00
build: avoid -Wignored-attributes on the popen deleter
- glibc declares pclose with function attributes (nothrow/leaf), so decltype(pclose)* carries attributes that gcc ignores on the unique_ptr template argument, emitting -Wignored-attributes - spell the deleter as a plain int(*)(FILE*) instead; pclose converts to it silently and the deleter behaves identically (both popen branches)
This commit is contained in:
committed by
Dennis Klein
parent
ab4bc49088
commit
4b2c6cafac
@@ -99,7 +99,7 @@ string getDefaultRouteNetworkInterface()
|
||||
string interfaceName;
|
||||
|
||||
#ifdef __APPLE__ // MacOS
|
||||
unique_ptr<FILE, decltype(pclose)*> file(
|
||||
unique_ptr<FILE, int (*)(FILE*)> file(
|
||||
popen("route -n get default | grep interface | cut -d \":\" -f 2", "r"), pclose);
|
||||
#else // Linux
|
||||
ifstream is("/proc/net/route");
|
||||
@@ -128,7 +128,7 @@ string getDefaultRouteNetworkInterface()
|
||||
LOG(debug) << "could not get network interface of the default route from /proc/net/route, "
|
||||
"going to try via 'ip route'";
|
||||
|
||||
unique_ptr<FILE, decltype(pclose)*> file(
|
||||
unique_ptr<FILE, int (*)(FILE*)> file(
|
||||
popen("ip route | grep default | cut -d \" \" -f 5 | head -n 1", "r"), pclose);
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user