Ubuntu编译gcc 7.1报错救命啊,解决了好久求大大帮忙看看
这是报错信息:
../../../../libsanitizer/tsan/tsan_platform_linux.cc: In function ‘int __tsan::ExtractResolvFDs(void*, int*, int)’:
../../../../libsanitizer/tsan/tsan_platform_linux.cc:290:16: error: ‘statp’ was not declared in this scope
__res_state *statp = (__res_state*)state;
^~~~~
../../../../libsanitizer/tsan/tsan_platform_linux.cc:290:16: note: suggested alternative: ‘state’
__res_state *statp = (__res_state*)state;
这是那段报错代码:
#if !SANITIZER_GO
// Extract file descriptors passed to glibc internal __res_iclose function.
// This is required to properly "close" the fds, because we do not see internal
// closes within glibc. The code is a pure hack.
int ExtractResolvFDs(void *state, int *fds, int nfd) {
#if SANITIZER_LINUX && !SANITIZER_ANDROID
int cnt = 0;
__res_state *statp = (__res_state*)state;
for (int i = 0; i < MAXNS && cnt < nfd; i++) {
if (statp->_u._ext.nsaddrs[i] && statp->_u._ext.nssocks[i] != -1)
fds[cnt++] = statp->_u._ext.nssocks[i];
}
return cnt;
#else
return 0;
#endif
}