Page MenuHomePhabricator

Bug 1946733 - Ignore -Walloc-size-larger-than= in `operator new[](nothrow)`.
ClosedPublic

Authored by jgilbert on Feb 24 2025, 9:59 PM.
Referenced Files
Unknown Object (File)
Fri, Apr 17, 1:44 AM
Unknown Object (File)
Sun, Apr 12, 12:31 PM
Unknown Object (File)
Sun, Apr 12, 12:31 PM
Unknown Object (File)
Fri, Apr 10, 12:00 PM
Unknown Object (File)
Fri, Apr 10, 9:32 AM
Unknown Object (File)
Sun, Apr 5, 6:33 AM
Unknown Object (File)
Mar 18 2026, 9:47 AM
Unknown Object (File)
Mar 10 2026, 12:40 PM
Subscribers

Details

Summary

Unfortunately, GCC-14 appears to be generating this warning due to its own
frontend/codegen [interactions?].

This is https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85783, which was
WONTFIX'd. Comment #3 admits:

The excessive constant argument is introduced by the C++ front-end, in
cp/build_operator_new_call(), which emits a call to operator new[](size_t).
The code was added in r190546 as a solution to prevent unsigned wrapping
(when array new expression must compute the amount of space to allocate as a
product of the number of elements and element size). When the replacement
operator new[] is inlined the excessive argument is propagated to malloc()
and ultimately triggers the warning.

Diff Detail

Event Timeline

phab-bot changed the visibility from "Custom Policy" to "Public (No Login Required)".
phab-bot changed the edit policy from "Custom Policy" to "Restricted Project (Project)".
phab-bot removed a project: secure-revision.
sylvestre edited reviewers, added: serge-sans-paille, Restricted Project; removed: sylvestre.Feb 25 2025, 9:14 AM
sergesanspaille added a subscriber: sergesanspaille.
sergesanspaille added inline comments.
This revision now requires changes to proceed.Feb 25 2025, 1:16 PM
jgilbert edited the summary of this revision. (Show Details)
jgilbert added a reviewer: sylvestre.
This revision is now accepted and ready to land.Feb 26 2025, 12:18 PM