Closed
Bug 1201628
Opened 11 years ago
Closed 5 years ago
Define MOZ_WARN_UNUSED_RESULT in MSVC
Categories
(Core :: MFBT, defect)
Core
MFBT
Tracking
()
RESOLVED
INVALID
People
(Reporter: mccr8, Unassigned)
Details
(Keywords: sec-audit, sec-want)
Attachments
(1 file)
|
1.34 KB,
patch
|
Details | Diff | Splinter Review |
Apparently MSVC has had this _Check_return_ thing since MSVC 2012 [1]. I'll try and see how it works. I don't have MSVC running locally so this may get painful fast, but I'll try at least a few pushes. I've hidden this for now because it may reveal security issues in Windows-specific code.
http://stackoverflow.com/questions/4226308/msvc-equivalent-of-attribute-warn-unused-result
| Reporter | ||
Comment 1•11 years ago
|
||
froydnj points out that the MSVC version requires annotating both the declaration and definition, according to that Stack Overflow answer, so this may not really be viable for us.
| Reporter | ||
Comment 2•11 years ago
|
||
The good news is that my try run is green. The bad news is that I think it shouldn't be.
I'll try adding another intentional failure and see if that does anything.
try: https://treeherder.mozilla.org/#/jobs?repo=try&revision=26fb7e857b90
| Reporter | ||
Comment 3•11 years ago
|
||
It sounds like maybe you have to run a different tool to get it to actually do something with these annotations, but I'm not entirely sure.
Comment 4•10 years ago
|
||
(In reply to Andrew McCreight [:mccr8] from comment #3)
> It sounds like maybe you have to run a different tool to get it to actually
> do something with these annotations, but I'm not entirely sure.
You need to run the compiler with -analyze. It would be interesting to run things with -analyze as-is (I think some of the Windows headers are appropriately annotated) and see if anything turns up.
| Reporter | ||
Comment 5•10 years ago
|
||
njn, I see you are on a bit of a warnings kick recently, and are messing with Windows, so I'm assuming you have a local way to build Windows. You may (or may not...) be interested in looking into seeing what this would turn up.
Flags: needinfo?(n.nethercote)
Comment 6•10 years ago
|
||
(In reply to Andrew McCreight [:mccr8] from comment #5)
> njn, I see you are on a bit of a warnings kick recently, and are messing
> with Windows, so I'm assuming you have a local way to build Windows.
I have a VirtualBox VM running Windows 8.1 on my Linux box. It was surprisingly easy to set up. You should totally try it sometime :)
I might take a look at this if I find some time, but I won't make any promises.
Flags: needinfo?(n.nethercote)
Updated•10 years ago
|
Group: core-security → dom-core-security
Updated•9 years ago
|
status-firefox43:
affected → ---
Comment 7•5 years ago
|
||
MSVC is no longer supported.
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → INVALID
Updated•3 years ago
|
Group: dom-core-security
You need to log in
before you can comment on or make changes to this bug.
Description
•