Closed Bug 1529105 Opened 1 year ago Closed 1 year ago

Compile warning in OpenVRSession.cpp: the use of `tmpnam' is dangerous

Categories

(Core :: WebVR, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla68
Tracking Status
firefox68 --- fixed

People

(Reporter: TYLin, Assigned: daoshengmu)

References

Details

Attachments

(1 file, 1 obsolete file)

The following warnings are shown after linking libxul.so.

 0:09.42 toolkit/library/libxul.so
 0:28.59 /home/tlin/Projects/gecko/gfx/vr/service/OpenVRSession.cpp:285: warning: the use of `tmpnam' is dangerous, better use `mkstemp'
 0:28.59 /home/tlin/Projects/gecko/gfx/vr/service/OpenVRSession.cpp:292: warning: the use of `tmpnam' is dangerous, better use `mkstemp'
 0:28.59 /home/tlin/Projects/gecko/gfx/vr/service/OpenVRSession.cpp:324: warning: the use of `tmpnam' is dangerous, better use `mkstemp'
 0:28.59 /home/tlin/Projects/gecko/gfx/vr/service/OpenVRSession.cpp:341: warning: the use of `tmpnam' is dangerous, better use `mkstemp'
 0:28.59 /home/tlin/Projects/gecko/gfx/vr/service/OpenVRSession.cpp:352: warning: the use of `tmpnam' is dangerous, better use `mkstemp'
 0:28.59 /home/tlin/Projects/gecko/gfx/vr/service/OpenVRSession.cpp:369: warning: the use of `tmpnam' is dangerous, better use `mkstemp'
 0:38.59 toolkit/library/dependentlibs.list.stub

FWIW, I compile on Linux using clang version clang version 6.0.0-1ubuntu2 (tags/RELEASE_600/final), and the following in my mozconfig.

ac_add_options --enable-debug
ac_add_options --disable-optimize

If it's intentional to use std::tmpnam(nullptr), maybe we should silence the warnings?

Thanks, TYLin.

I think we should replace std::tmpnam with std::tmpnam_s. I will work on this shortly.

Assignee: nobody → dmu

we will target it to FF 68.

Duplicate of this bug: 1515850

daoshengmu, the patch does not have any reviewers. Do you consider it finished?

Flags: needinfo?(dmu)

(In reply to Frederik Braun [:freddyb] from comment #6)

daoshengmu, the patch does not have any reviewers. Do you consider it finished?

I haven't done it yet but close. I will continue to work on this this week.

Flags: needinfo?(dmu)
Attachment #9049043 - Attachment is obsolete: true
Pushed by dmu@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/bb714fa13ef9
Replace tmpname in OpenVRSession when using action input. r=kip
Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla68
You need to log in before you can comment on or make changes to this bug.