Bug #44
closedimplicit declaration of function 'sched_getcpu'
0%
Description
While compiling latest lttng-ust git HEAD, I'm getting the following warnings (see attached build log):
warning: implicit declaration of function 'sched_getcpu' [-Wimplicit-function-declaration]
which usually indicate a function simply doesn't exist.
This might be due to the new eglibc version in Ubuntu 12.04, which is 2.15. Compared to 2.13 currently in Debian Sid and Ubuntu 11.10. I tried some basic grep'ing but couldn't find a reference to "sched_getcpu" in either.
Files
Updated by Yannick Brosseau almost 13 years ago
- Assignee set to Mathieu Desnoyers
- Target version set to 2.0 RC1
Updated by Anonymous almost 13 years ago
lttng-tools gives a similar warning too, but only once.
No similar warnings when building liburcu on the same system, however.
Updated by Mathieu Desnoyers almost 13 years ago
- Status changed from New to Feedback
Please try again with the following two UST commits:
commit 5ad63a1632792c8bc40fa5bc9f7f45f037a68032
Author: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Date: Tue Feb 14 19:12:35 2012 -0500
Define _GNU_SOURCE for all implementation files rather than getcpu.h
If implementation files include the sched.h header prior to having
_GNU_SOURCE defined by getcpu.h, we get in a situation where
sched_getcpu() can be undeclared.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
commit e9d165be13c8d6e3c0f60e5eca9bf2c5fbfa7712
Author: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Date: Tue Feb 14 19:06:52 2012 -0500
Add sched_getcpu and sysconf to AC_CHECK_FUNCS
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Updated by Anonymous almost 13 years ago
I retried with today's git HEAD. It did remove some of the implicit-declaration warnings, but not all of them.
I attached the new build log.
Updated by Mathieu Desnoyers almost 13 years ago
On my Debian wheezy/sid system, I got:
compudj@thinkos:/usr/include$ grep -r sched_getcpu *
x86_64-linux-gnu/bits/sched.h:extern int sched_getcpu (void) __THROW;
Do you have something similar ?
Updated by Mathieu Desnoyers almost 13 years ago
Please try again with:
commit 9d335227b11499758dc06d97822ba2ebeeb0fd5c
Author: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Date: Wed Feb 15 22:23:47 2012 -0500
Add missing #define _GNU_SOURCE for sched_getcpu()
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Updated by Anonymous almost 13 years ago
- Status changed from Feedback to Resolved
I have the same:
x86_64-linux-gnu/bits/sched.h:extern int sched_getcpu (void) __THROW;
But I can confirm with the latest HEAD, there are no more of those warnings. One step closer to building with -Werror ;)