2016-11-29 79 views
2

我得到一對警告用glibc 2.22版本:我可以通過glibc安全地忽略這些pthread警告嗎?

In file included from /net/module/sw/glibc/2.22/include/pthread.h:23:0, 
       from foo.h:48, 
       from foo.c:23: 
/net/module/sw/glibc/2.22/include/sched.h:74:57: warning: ‘struct timespec’ declared inside parameter list 
extern int sched_rr_get_interval (__pid_t __pid, struct timespec *__t) __THROW; 
                 ^
/net/module/sw/glibc/2.22/include/sched.h:74:57: warning: its scope is only this definition or declaration, which is probably not what you want 
In file included from foo.h:48:0, 
       from foo.c:23: 
/net/module/sw/glibc/2.22/include/pthread.h:1002:21: warning: ‘struct timespec’ declared inside parameter list 
     const struct timespec *__restrict __abstime) 
        ^

和:

In file included from /net/module/sw/glibc/2.22/include/sys/param.h:26:0, 
       from foo.h:51, 
       from foo.c:23: 
/net/module/sw/glibc/2.22/include/limits.h:123:3: warning: #include_next is a GCC extension 
# include_next <limits.h> 
^

我使用GCC 5.3.0這個版本的glibc。

由於這些警告是引用外部庫,我不控制,如果我的應用程序似乎通過測試,我可以安全地忽略這些警告嗎?

我擔心的是,這些警告(尤其是有關pthread)可能表明引入微妙的錯誤的,我沒有測試,以趕上。

回答

0

是,這些警告應該是無害的,但struct timespec警告肯定是奇數。通常,他們會被GCC對系統頭文件的警告抑制所掩蓋。

相關問題