Closed Bug 1377951 Opened 7 years ago Closed 7 years ago

Unused variable warning-as-error in Mingw in ArrayBufferObject.cpp

Categories

(Core :: JavaScript Engine, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla57
Tracking Status
firefox57 --- fixed

People

(Reporter: tjr, Assigned: tjr)

References

Details

(Whiteboard: [tor])

Attachments

(1 file)

In js/src/vm/ArrayBufferObject.cpp, mappedSizeWithHeader is not used unless we are on non-Windows or are using Valgrind. (I don't believe we are ever using valgrind on Windows.)

This causes a warning-as-error:

> /home/worker/workspace/build/src/js/src/vm/ArrayBufferObject.cpp:685:12: error: unused variable 'mappedSizeWithHeader' [-Werror=unused-variable]
>      size_t mappedSizeWithHeader = header->mappedSize() + gc::SystemPageSize();
Comment on attachment 8883085 [details]
Bug 1377951 Move a variable so it does not generate unused variable warnings (as errors) in MinGW

https://reviewboard.mozilla.org/r/154046/#review159182

::: js/src/vm/ArrayBufferObject.cpp:690
(Diff revision 1)
>  
>      MemProfiler::RemoveNative(base);
>  # ifdef XP_WIN
>      VirtualFree(base, 0, MEM_RELEASE);
>  # else  // XP_WIN
> +    size_t mappedSizeWithHeader = header->mappedSize() + gc::SystemPageSize();

mappedSizeWithHeader is used also in VALGRIND_ENABLE_ADDR_ERROR_REPORTING_IN_RANGE, so moving the definition here is not correct.
Attachment #8883085 - Flags: review-
Comment on attachment 8883085 [details]
Bug 1377951 Move a variable so it does not generate unused variable warnings (as errors) in MinGW

https://reviewboard.mozilla.org/r/154046/#review159186

sorry, I overlooked the reasoning in comment #0.
clearing r- for now
Attachment #8883085 - Flags: review-
Comment on attachment 8883085 [details]
Bug 1377951 Move a variable so it does not generate unused variable warnings (as errors) in MinGW

https://reviewboard.mozilla.org/r/154046/#review176272

we could re-think about the conditions once someone hit the issue on windows with configuration that valgrind is enabled (I cannot think of the case tho, there might be some use case).
Attachment #8883085 - Flags: review?(arai.unmht) → review+
Pushed by philringnalda@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/66d6a3d2b97f
Move a variable so it does not generate unused variable warnings (as errors) in MinGW r=arai
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/66d6a3d2b97f
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: