Attempting to use mkstemp() with the -Wall argument specified, the message "bug.c:8: warning: implicit declaration of function ‘mkstemp’" is issued even though stdlib.h is #included. The sample program is stripped to the bones so there is little extraneous material. Below is the compiler with options as requested:
$ gcc -c bug.c -ansi -Wall -v -save-temps Using built-in specs. Target: i386-redhat-linux Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-libgcj-multifile --enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk --disable-dssi --with-java-home=/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre --with-cpu=generic --host=i386-redhat-linux Thread model: posix gcc version 4.1.1 20060525 (Red Hat 4.1.1-1) /usr/libexec/gcc/i386-redhat-linux/4.1.1/cc1 -E -quiet -v bug.c -mtune=generic -ansi -Wall -fpch-preprocess -o bug.i ignoring nonexistent directory "/usr/lib/gcc/i386-redhat-linux/4.1.1/../../../../i386-redhat-linux/include" #include "..." search starts here: #include <...> search starts here: /usr/local/include /usr/lib/gcc/i386-redhat-linux/4.1.1/include /usr/include End of search list. /usr/libexec/gcc/i386-redhat-linux/4.1.1/cc1 -fpreprocessed bug.i -quiet -dumpbase bug.c -mtune=generic -ansi -auxbase bug -Wall -ansi -version -o bug.s GNU C version 4.1.1 20060525 (Red Hat 4.1.1-1) (i386-redhat-linux) compiled by GNU C version 4.1.1 20060525 (Red Hat 4.1.1-1). GGC heuristics: --param ggc-min-expand=63 --param ggc-min-heapsize=62486 Compiler executable checksum: 7a31534f101210f86e6343d2c0c239f8 bug.c: In function ‘main’: bug.c:8: warning: implicit declaration of function ‘mkstemp’ as -V -Qy -o bug.o bug.s GNU assembler version 2.16.91.0.6 (i386-redhat-linux) using BFD version 2.16.91.0.6 20060212 -- Summary: no prototype in stdlib.h for mkstemp() Product: gcc Version: 4.1.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: robert-gcc at pine-ridge dot ca GCC build triplet: ??? GCC host triplet: ??? GCC target triplet: ??? http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28485