Closed
Bug 1406197
Opened 7 years ago
Closed 7 years ago
[-Wsized-deallocation] warning in mozalloc.h
Categories
(Core :: Memory Allocator, defect)
Core
Memory Allocator
Tracking
()
RESOLVED
FIXED
mozilla58
Tracking | Status | |
---|---|---|
firefox58 | --- | fixed |
People
(Reporter: tjr, Assigned: tjr)
References
Details
Attachments
(1 file)
gcc 6.4.0 in the mingw build is throwing these warnings:
> /builds/worker/workspace/build/src/obj-firefox/dist/include/mozilla/mozalloc.h:228:6: warning: the program should also define 'void operator delete(void*, std::size_t)' [-Wsized-deallocation]
> void operator delete(void* ptr) MOZALLOC_THROW_IF_HAS_EXCEPTIONS
> ^~~~~~~~
> /builds/worker/workspace/build/src/obj-firefox/dist/include/mozilla/mozalloc.h:240:6: warning: the program should also define 'void operator delete [](void*, std::size_t)' [-Wsized-deallocation]
> void operator delete[](void* ptr) MOZALLOC_THROW_IF_HAS_EXCEPTIONS
> ^~~~~~~~
From what I've been able to read[0][1], I think I can resolve this by adding functions that just call `return free_impl(ptr);` and ignore the size argument, which I will do unless anyone thinks that's a bad approach.
[0] https://isocpp.org/files/papers/n3778.html
[1] https://github.com/cpputest/cpputest/pull/987
Comment hidden (mozreview-request) |
![]() |
||
Comment 2•7 years ago
|
||
mozreview-review |
Comment on attachment 8916069 [details]
Bug 1406197 Declare sized deallocators (that ignore the size) to correct a MinGW warning
https://reviewboard.mozilla.org/r/187320/#review192374
::: memory/mozalloc/mozalloc.h:234
(Diff revision 1)
> {
> return free_impl(ptr);
> }
>
> MOZALLOC_EXPORT_NEW MOZALLOC_INLINE
> +void operator delete(void* ptr, size_t size) MOZALLOC_THROW_IF_HAS_EXCEPTIONS
We should probably declare these only when we're compiling with C++14.
::: memory/mozalloc/mozalloc.h:252
(Diff revision 1)
> {
> return free_impl(ptr);
> }
>
> MOZALLOC_EXPORT_NEW MOZALLOC_INLINE
> +void operator delete[](void* ptr, size_t size) MOZALLOC_THROW_IF_HAS_EXCEPTIONS
Likewise here?
Comment hidden (mozreview-request) |
Comment 4•7 years ago
|
||
mozreview-review |
Comment on attachment 8916069 [details]
Bug 1406197 Declare sized deallocators (that ignore the size) to correct a MinGW warning
https://reviewboard.mozilla.org/r/187320/#review193056
::: memory/mozalloc/mozalloc.h:233
(Diff revision 2)
> void operator delete(void* ptr) MOZALLOC_THROW_IF_HAS_EXCEPTIONS
> {
> return free_impl(ptr);
> }
>
> +#if __cplusplus >= 201300L
why not 201402L?
Attachment #8916069 -
Flags: review?(mh+mozilla)
Assignee | ||
Comment 5•7 years ago
|
||
mozreview-review |
Comment on attachment 8916069 [details]
Bug 1406197 Declare sized deallocators (that ignore the size) to correct a MinGW warning
https://reviewboard.mozilla.org/r/187320/#review193244
::: memory/mozalloc/mozalloc.h:233
(Diff revision 2)
> void operator delete(void* ptr) MOZALLOC_THROW_IF_HAS_EXCEPTIONS
> {
> return free_impl(ptr);
> }
>
> +#if __cplusplus >= 201300L
You're right.
I was following https://bugzilla.mozilla.org/show_bug.cgi?id=1325632#c29 and https://bugzilla.mozilla.org/show_bug.cgi?id=1392643 which account for gcc 4.9 having Draft C++14 support, and used that constan, but this warning didn't show up until gcc 6 which has full support.
Comment hidden (mozreview-request) |
Comment 7•7 years ago
|
||
mozreview-review |
Comment on attachment 8916069 [details]
Bug 1406197 Declare sized deallocators (that ignore the size) to correct a MinGW warning
https://reviewboard.mozilla.org/r/187320/#review193452
Attachment #8916069 -
Flags: review?(mh+mozilla) → review+
Assignee | ||
Updated•7 years ago
|
Keywords: checkin-needed
Pushed by ryanvm@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/d346efc8449b
Declare sized deallocators (that ignore the size) to correct a MinGW warning r=glandium
Keywords: checkin-needed
![]() |
||
Comment 9•7 years ago
|
||
bugherder |
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla58
You need to log in
before you can comment on or make changes to this bug.
Description
•