From Bugzilla Helper: User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.8) Gecko/20050511 Firefox/1.0.4 Description of problem: When you compile the following hello.c file: #include <unistd.h> int main(void) { getdtablesize(); return 0; } compile it with option: gcc -c -std=c99 hello.c gives the following warning(while it should not): hello.c: In function `main': hello.c:8: warning: implicit declaration of function `getdtablesize' Version-Release number of selected component (if applicable): gcc-3.4.3-22.fc3 How reproducible: Always Steps to Reproduce: 1.create a file named hello.c with the above contents 2.compile it with option "-std=c99" 3. Actual Results: You got warnings like: hello.c: In function `main': hello.c:8: warning: implicit declaration of function `getdtablesize' Expected Results: You should not expect any warnings at all. Additional info: No. It's very easy to reproduce the bug.
By using -std=c99, you select strict ISO C99 namespace. getdtablesize is only provided in BSD and X/Open namespaces. When -std=c99 is not given, the default is BSD and SVID namespace and therefore getdtablesize has a prototype. If you want the getdtablesize prototype provided also with -std=c99, you need to select some namespace that includes it. So e.g. -std=c99 -D_GNU_SOURCE -std=c99 -D_BSD_SOURCE -std=c99 -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED -std=c99 -D_XOPEN_SOURCE=500 -std=c99 -D_XOPEN_SOURCE=600 -std=gnu99 depending on which standard your program attempts to conform to. See info libc on Feature Test Macros.