Closed
Bug 1383919
Opened 8 years ago
Closed 8 years ago
Avoid "dynamic exception specifications are deprecated in C++11" warning with GCC 7
Categories
(Core :: Memory Allocator, defect)
Tracking
()
RESOLVED
FIXED
mozilla57
| Tracking | Status | |
|---|---|---|
| firefox57 | --- | fixed |
People
(Reporter: botond, Assigned: botond)
References
Details
Attachments
(1 file)
When building trunk with GCC 7, I see warnings like this:
0:17.55 /home/botond/dev/projects/mozilla/central/obj-x86_64-pc-linux-gnu/dist/include/mozilla/mozalloc.h:180:52: warning: dynamic exception specifications are deprecated in C++11 [-Wdeprecated]
0:17.55 #define MOZALLOC_THROW_BAD_ALLOC_IF_HAS_EXCEPTIONS throw(std::bad_alloc)
0:17.55 ^
0:17.55 /home/botond/dev/projects/mozilla/central/obj-x86_64-pc-linux-gnu/dist/include/mozilla/mozalloc.h:183:34: note: in expansion of macro ‘MOZALLOC_THROW_BAD_ALLOC_IF_HAS_EXCEPTIONS’
0:17.55 #define MOZALLOC_THROW_BAD_ALLOC MOZALLOC_THROW_BAD_ALLOC_IF_HAS_EXCEPTIONS
0:17.55 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
0:17.55 /home/botond/dev/projects/mozilla/central/obj-x86_64-pc-linux-gnu/dist/include/mozilla/mozalloc.h:192:33: note: in expansion of macro ‘MOZALLOC_THROW_BAD_ALLOC’
0:17.55 void* operator new(size_t size) MOZALLOC_THROW_BAD_ALLOC
0:17.55 ^~~~~~~~~~~~~~~~~~~~~~~~
Basically, we are using |throw(std::bad_alloc)|, but dynamic exception specifications have been deprecated in C++11. The C++11 equivalent is |noexcept(false)|.
It should be straightforward to use |noexcept(false)| when appropriate.
| Comment hidden (mozreview-request) |
| Assignee | ||
Updated•8 years ago
|
Assignee: nobody → botond
Comment 2•8 years ago
|
||
| mozreview-review | ||
Comment on attachment 8889692 [details]
Bug 1383919 - Use |noexcept| instead of an exception-specification in mozalloc.h.
https://reviewboard.mozilla.org/r/160754/#review168650
Attachment #8889692 -
Flags: review?(mh+mozilla) → review+
Pushed by bballo@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/ae7e3082d862
Use |noexcept| instead of an exception-specification in mozalloc.h. r=glandium
Updated•8 years ago
|
Blocks: build-gcc-7
Comment 5•8 years ago
|
||
| bugherder | ||
Status: NEW → RESOLVED
Closed: 8 years ago
status-firefox57:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla57
You need to log in
before you can comment on or make changes to this bug.
Description
•