This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: implicit declaration of function ‘__sysconf’
- From: kamaraju kusumanchi <raju dot mailinglists at gmail dot com>
- To: Ian Lance Taylor <iant at google dot com>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Sat, 21 May 2011 04:31:29 -0400
- Subject: Re: implicit declaration of function ‘__sysconf’
- References: <ir4hpi$pat$1@dough.gmane.org> <mcr1uzs4mcc.fsf@coign.corp.google.com>
>
> The warning, converted to an error due to -Werror, means that the macro
> calls the function __sysconf, and that function is not declared.
>
> Your test case works fine on my Ubuntu Lucid system. ?To figure out what
> is happening on your system, you need to look at the definition of NBPG.
> I don't know why it is calling __sysconf rather than sysconf. ?sysconf
> is declared in <unistd.h>. ?I don't know where __sysconf is declared.
> You could try simply grepping in /usr/include.
>
Thanks for the reply. It helps. I think this is a bug in libc6-dev
then (which provides /usr/include/sys/user.h) .
In libc6-dev 2.13-4, I have
debian_chroot:sid:kusumanchi:/home# grep "define NBPG" /usr/include/sys/user.h
#define NBPG PAGE_SIZE
debian_chroot:sid:kusumanchi:/home# grep "define PAGE_SIZE"
/usr/include/sys/user.h
#define PAGE_SIZE (__sysconf(_SC_PAGESIZE))
where as in libc6-dev 2.11.2-10, I have
$grep "define NBPG" /usr/include/sys/user.h
#define NBPG PAGE_SIZE
$grep "define PAGE_SIZE" /usr/include/sys/user.h
#define PAGE_SIZE (sysconf(_SC_PAGESIZE))
The testcase I gave works in libc6-dev 2.11.2-10, gcc 4:4.4.5-1 and
fails in libc6-dev 2.13-4, gcc 4:4.6.0-5.
raju
--
Kamaraju S Kusumanchi
http://malayamaarutham.blogspot.com/