Re: implicit declaration of function ‘__sysconf’

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Kamaraju S Kusumanchi <raju.mailinglists@xxxxxxxxx> writes:

> This must be a trivial question. Consider the following test case
>
>
> debian_chroot:sid:kusumanchi:/home/625341/w2# cat test.c 
> #include <sys/user.h>
>
> void test (long int a);
>
> void test (long int a)
> {
>     a = NBPG;
> }
>
>
> debian_chroot:sid:kusumanchi:/home/625341/w2# gcc -c -Wall -Werror test.c
> test.c: In function âtestâ:
> test.c:7:5: error: implicit declaration of function â__sysconfâ [-
> Werror=implicit-function-declaration]
> cc1: all warnings being treated as errors
>
>
> What should I do to make this warning go away? I am trying to reduce the 
> testcase for http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=627273 and fix 
> the build failure. But no matter what I do, I am unable to eliminate the 
> warning.
>
> I tried inserting
> #include <unistd.h>
>
> but that did not help. Any other suggestions?

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.

Ian



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux