Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 50418 - gcc 2.96 - bogus warning for tmpnam()
gcc 2.96 - bogus warning for tmpnam()
Product: Red Hat Linux
Classification: Retired
Component: gcc (Show other bugs)
ia64 Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
David Lawrence
Depends On:
  Show dependency treegraph
Reported: 2001-07-30 21:50 EDT by Martin Sebor
Modified: 2007-04-18 12:35 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2001-07-30 21:50:16 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Martin Sebor 2001-07-30 21:50:11 EDT
Apparently, the C++ compiler driver (but not the C one) decides that I shouldn't be using the ANSI C function tmpnam() and instead 
recommends the non-ANSI C mkstemp(). This even with the -pedantic and -strict options, where conformance to ANSI C rather than POSIX is 
clearly desired :)


$ cat t.cpp ; gcc -v t.cpp
#include <stdio.h>

int main ()
    tmpnam (0);

Reading specs from /package/1/ia64/compilers/gcc-2.96-85/bin/../lib/gcc-lib/ia64-redhat-linux/2.96/specs
gcc version 2.96 20000731 (Red Hat Linux 7.1 2.96-85)
 /package/1/ia64/compilers/gcc-2.96-85/bin/../lib/gcc-lib/ia64-redhat-linux/2.96/cpp0 -lang-c++ -D__GNUG__=2 -D__EXCEPTIONS -v -iprefix 
/package/1/ia64/compilers/gcc-2.96-85/bin/../lib/gcc-lib/ia64-redhat-linux/2.96/ -D__GNUC__=2 -D__GNUC_MINOR__=96 
-D__GNUC_PATCHLEVEL__=0 -D__ia64 -D__ia64__ -D__linux -D__linux__ -D_LONGLONG -Dlinux -Dunix -D__LP64__ -D__ELF__ 
-D__ia64 -D__ia64__ -D__linux -D__linux__ -D_LONGLONG -D__linux__ -D__unix__ -D__LP64__ -D__ELF__ -D__linux -D__unix 
-Asystem(linux) -Acpu(ia64) -Amachine(ia64) -D__NO_INLINE__ -D__LONG_MAX__=9223372036854775807L t.cpp /tmp/ccfGHa1e.ii
GNU CPP version 2.96 20000731 (Red Hat Linux 7.1 2.96-85) (cpplib) (IA-64)
#include "..." search starts here:
#include <...> search starts here:
End of search list.
 /package/1/ia64/compilers/gcc-2.96-85/bin/../lib/gcc-lib/ia64-redhat-linux/2.96/cc1plus /tmp/ccfGHa1e.ii -mb-step -quiet -dumpbase t.cpp 
-version -o /tmp/ccoa7Rfo.s
GNU C++ version 2.96 20000731 (Red Hat Linux 7.1 2.96-85) (ia64-redhat-linux) compiled by GNU C version 2.96 20000731 (Red Hat Linux 
7.1 2.96-85).
 as -x -o /tmp/ccl0C52B.o /tmp/ccoa7Rfo.s
 /package/1/ia64/compilers/gcc-2.96-85/bin/../lib/gcc-lib/ia64-redhat-linux/2.96/collect2 -dynamic-linker /lib/ld-linux-ia64.so.2 /usr/lib/crt1.o 
/usr/lib/crti.o /package/1/ia64/compilers/gcc-2.96-85/bin/../lib/gcc-lib/ia64-redhat-linux/2.96/crtbegin.o 
-L/package/1/ia64/compilers/gcc-2.96-85/bin/../lib/gcc-lib/ia64-redhat-linux/2.96 -L/package/1/ia64/compilers/gcc-2.96-85/bin/../lib/gcc-lib 
-L/usr/package/1/compilers/gcc-2.96-85-ia64/lib/gcc-lib/ia64-redhat-linux/2.96/../../.. /tmp/ccl0C52B.o -lgcc -lc -lgcc 
/package/1/ia64/compilers/gcc-2.96-85/bin/../lib/gcc-lib/ia64-redhat-linux/2.96/crtend.o /usr/lib/crtn.o
/tmp/ccl0C52B.o: In function `main':
/tmp/ccl0C52B.o(.text+0x22): the use of `tmpnam' is dangerous, better use `mkstemp'
Comment 1 Bill Nottingham 2001-07-31 01:54:19 EDT
the warning is not from the compiler, it's from glibc.

Note You need to log in before you can comment on or make changes to this bug.