[Bug c/97274] New: Need ability to ensure no warning about tmpnam

eyalroz at technion dot ac.il gcc-bugzilla@gcc.gnu.org
Fri Oct 2 17:06:36 GMT 2020


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97274

            Bug ID: 97274
           Summary: Need ability to ensure no warning about tmpnam
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: eyalroz at technion dot ac.il
  Target Milestone: ---

If you use tmpnam, or std::tmpnam in C++, you get a linker (not compiler,
linker) warning:

/usr/bin/ld:
CMakeFiles/simpleDrvRuntimePTX.dir/modified_cuda_samples/simpleDrvRuntimePTX/simpleDrvRuntimePTX.cpp.o:
in function `create_ptx_file[abi:cxx11]()':
/home/eyalroz/src/mine/cuda-api-wrappers/examples/modified_cuda_samples/simpleDrvRuntimePTX/simpleDrvRuntimePTX.cpp:105:
warning: the use of `tmpnam' is dangerous, better use `mkstemp'

there should be a way to disable that warning, when invoking the compiler
without separate linking, or simply when invoking the linker. I'm not sure if
this bug should even be filed here, since it's not obvious to me who is
"responsible" for the linker emitting this error.


More information about the Gcc-bugs mailing list