Bug #44
closed
implicit declaration of function 'sched_getcpu'
Added by Anonymous almost 13 years ago.
Updated almost 13 years ago.
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
- Assignee set to Mathieu Desnoyers
- Target version set to 2.0 RC1
lttng-tools gives a similar warning too, but only once.
No similar warnings when building liburcu on the same system, however.
- 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>
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.
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 ?
- 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 ;)
Also available in: Atom
PDF