Project

General

Profile

Actions

Bug #44

closed

implicit declaration of function 'sched_getcpu'

Added by Anonymous about 12 years ago. Updated about 12 years ago.

Status:
Resolved
Priority:
Normal
Target version:
Start date:
02/12/2012
Due date:
% Done:

0%

Estimated time:

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

buildlog (11.8 KB) buildlog Anonymous, 02/12/2012 01:48 AM
buildlog2 (11 KB) buildlog2 Anonymous, 02/15/2012 11:43 AM
Actions #1

Updated by Yannick Brosseau about 12 years ago

  • Assignee set to Mathieu Desnoyers
  • Target version set to 2.0 RC1
Actions #2

Updated by Anonymous about 12 years ago

lttng-tools gives a similar warning too, but only once.

No similar warnings when building liburcu on the same system, however.

Actions #3

Updated by Mathieu Desnoyers about 12 years ago

  • Status changed from New to Feedback

Please try again with the following two UST commits:

commit 5ad63a1632792c8bc40fa5bc9f7f45f037a68032
Author: Mathieu Desnoyers <>
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 &lt;&gt;

commit e9d165be13c8d6e3c0f60e5eca9bf2c5fbfa7712
Author: Mathieu Desnoyers <>
Date: Tue Feb 14 19:06:52 2012 -0500

Add sched_getcpu and sysconf to AC_CHECK_FUNCS
Signed-off-by: Mathieu Desnoyers &lt;&gt;
Actions #4

Updated by Anonymous about 12 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.

Actions #5

Updated by Mathieu Desnoyers about 12 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 ?

Actions #6

Updated by Mathieu Desnoyers about 12 years ago

Please try again with:

commit 9d335227b11499758dc06d97822ba2ebeeb0fd5c
Author: Mathieu Desnoyers <>
Date: Wed Feb 15 22:23:47 2012 -0500

Add missing #define _GNU_SOURCE for sched_getcpu()
Signed-off-by: Mathieu Desnoyers &lt;&gt;
Actions #7

Updated by Anonymous about 12 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 ;)

Actions

Also available in: Atom PDF