Closed Bug 1377948 Opened 7 years ago Closed 7 years ago

MinGW complains abaout unused statements and variables in js/src/vm/Time.cpp

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla57
Tracking Status
firefox57 --- fixed

People

(Reporter: tjr, Assigned: tjr)

References

Details

(Whiteboard: [tor])

Attachments

(1 file)

> In file included from /home/worker/workspace/build/src/obj-firefox/js/src/Unified_cpp_js_src37.cpp:29:0:
> /home/worker/workspace/build/src/js/src/vm/Time.cpp: In function 'size_t PRMJ_FormatTime(char*, int, const char*, PRMJTime*)':
> /home/worker/workspace/build/src/js/src/vm/Time.cpp:353:50: error: statement has no effect [-Werror=unused-value]
>      _CrtSetReportMode(_CRT_ASSERT, oldReportMode);
>                                                   ^
> /home/worker/workspace/build/src/js/src/vm/Time.cpp:272:9: error: variable 'oldReportMode' set but not used [-Werror=unused-but-set-variable]
>      int oldReportMode;
Comment on attachment 8883083 [details]
Bug 1377948 Silence two warnings that occur as errors on the MinGW build

https://reviewboard.mozilla.org/r/154040/#review159176

The warning is because of that MinGW doesn't support _CrtSetReportMode properly, and it has the following definition (or similar)

> #define _CrtSetReportMode(t,f) ((int)0)

so, I guess ignoring the warning is not a good idea here, because it could result in overlooking actual issue elsewhere in the future.

maybe we could enclose those lines by #ifdef _MSC_VER, so that the code is used only in MSVC.
Attachment #8883083 - Flags: review-
Attachment #8883083 - Flags: review?(arai.unmht)
Comment on attachment 8883083 [details]
Bug 1377948 Silence two warnings that occur as errors on the MinGW build

https://reviewboard.mozilla.org/r/154040/#review159190

Looks good, supposing it passes try run :)
Attachment #8883083 - Flags: review?(arai.unmht) → review+
Pushed by ryanvm@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/dd9b0b8c781c
Silence two warnings that occur as errors on the MinGW build r=arai
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/dd9b0b8c781c
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla57
No longer blocks: 1330608
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: