Closed Bug 1635968 Opened 5 years ago Closed 2 years ago

A standalone "#include <set>" breaks the build on Fedora 32 with error: exception specification in declaration does not match previous declaration malloc|calloc|realloc

Categories

(Core :: Memory Allocator, defect)

defect

Tracking

()

RESOLVED FIXED

People

(Reporter: mstange, Unassigned)

Details

If the first #include in a compilation unit is #include <set>, or any other header that includes "mozalloc.h" before including <cstdlib>, then the build breaks on Fedora 32 on Bob Clary's machine. See bug 1635803 comment 0 for the full error message.

The cause of the error boils down to the following. This order of declaring malloc seems to be fine:

extern void *malloc (size_t __size) throw () __attribute__ ((__malloc__))
                                    __attribute__ ((__warn_unused_result__));

extern "C" __attribute__((visibility("default"))) void* malloc(size_t);

But the reverse order is rejected, with the error "exception specification in declaration does not match previous declaration".

Including just <set>, with nothing that includes <cstdlib> before, produces the wrong order.
See bug 1635803 comment 5 for the include paths from <set> that produce this order.

I'm going to land a workaround for now, but I'm a bit surprised that this issue isn't hit elsewhere in the tree.

The severity field is not set for this bug.
:glandium, could you have a look please?

For more information, please visit auto_nag documentation.

Flags: needinfo?(mh+mozilla)
Severity: -- → S4

I think this was fixed in bug 1648340.

Status: NEW → RESOLVED
Closed: 2 years ago
Flags: needinfo?(mh+mozilla)
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.