Closed Bug 1614840 Opened 6 years ago Closed 6 years ago

The "fopen-usage" static analysis checker should not warn std::(i|o)?fstream::open(const wchar_t*, ...) overloads

Categories

(Developer Infrastructure :: Source Code Analysis, defect)

defect
Not set
normal

Tracking

(firefox75 fixed)

RESOLVED FIXED
mozilla75
Tracking Status
firefox75 --- fixed

People

(Reporter: emk, Assigned: emk)

References

(Regression)

Details

(Keywords: regression)

Attachments

(1 file)

These overloads are not lossy and should not be banned. Rather, they should be suggested as a replacement of std::(i|o)?fstream::open(const char*, ...).

Currently, this checker gets false positives, for example here:
https://searchfox.org/mozilla-central/rev/7e92a667e3829831c31e8d46aefe7ef67ad5be1c/ipc/chromium/src/base/file_path.cc#278

isAnyCharacter will match not only char, but also wchar_t. We should not match wchar_t.
https://searchfox.org/mozilla-central/rev/7e92a667e3829831c31e8d46aefe7ef67ad5be1c/build/clang-plugin/FopenUsageChecker.cpp#11

Assignee: nobody → VYV03354
Status: NEW → ASSIGNED
Pushed by VYV03354@nifty.ne.jp: https://hg.mozilla.org/integration/autoland/rev/2be96e20ef29 Fix fopen-usage checker so that it does not match wchar_t. r=andi
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla75
Has Regression Range: --- → yes
Keywords: regression
Product: Firefox Build System → Developer Infrastructure
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: