Irritating warnings about implicit functions

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

 



Hi everyone,

I hope this doesn't show up twice.  My first attempt failed because it was html formatted (thought I had it configured to send plain text here).

I'm compiling some C code with the following options:

-std=c99 -O3 -Wall

I have  one source file in particular which includes all of the appropriate files for syscall(), popen() and pclose().  Yet, each time I compile the file I'm greeted with:

warning: implicit declaration of function 'syscall'

And likewise for popen() and pclose().  I've done some digging and found that GCC supports feature test macros.  To that end, I've taken the recommended action, according to http://www.gnu.org/software/libc/manual/html_node/Feature-Test-Macros.html, and have done 

#ifndef _GNU_SOURCE
#define _GNU_SOURCE
#endif

The effect of defining this macro means that _POSIX_C_SOURCE is set to a value of 2.  Earlier in this html doc it states that defining _GNU_SOURCE means that, among other macros, _POSIX_C_SOURCE is set to a value of 2.  However, even after placing 

#define _GNU_SOURCE

at the beginning of my *.c file, before *any* includes, I continue to see this annoying warning.  I've done

gcc -E  source.c |gvim -

to read over what the preprocessor is bringing in and sure enough, syscall(), popen() and pclose() are in there.  Yet, with -std=c99, this warning persists.  I've discovered that I can get around this warning by using -std=gnu89.  Thankfully, the GNU extensions to the C89 standard include some of the things I'm using like for loop index declaration within the loop definition.  So, my question is, am I missing something or is this a bug (which won't be fixed because I'm on an older compiler)?

Just for everyone's info, I'm using gcc 4.4.4 on CentOS 6.2.

Thanks,
Andy





[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