https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85783
Martin Sebor changed:
What|Removed |Added
Status|REOPENED|RESOLVED
Resolution|---
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85783
Eric Gallager changed:
What|Removed |Added
CC||egallager at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85783
Alexander Monakov changed:
What|Removed |Added
Status|RESOLVED|REOPENED
Last reconfirmed|
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85783
--- Comment #9 from Paul Smith ---
Sorry; Andrew's original reply seemed to say that the use-case is
non-conforming so the issue was WONTFIX. I also thought your comment #6 was
referring to my example in comment #5: I just wanted to clarify
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85783
--- Comment #8 from Martin Sebor ---
There is no standard way to say "don't inline this function." It's up to the
compiler to decide what to inline just so long as it doesn't violate the
requirements.
There is also no requirement that the
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85783
--- Comment #7 from Paul Smith ---
Is there a way (in standard C++) to force non-inline? I'm not aware of one.
So that means the only standard-conforming way to replace operator new is if
it's in its own compilation unit all by itself? I
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85783
--- Comment #6 from Martin Sebor ---
Inlining happens automatically unless it's disabled. The inlining of the
operator results in the excessive constant argument (created by the C++
front-end) to propagate to the call to malloc(). That's what
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85783
--- Comment #5 from Paul Smith ---
I simplified my example too much; I think this should be re-opened.
In my real code, operator new[] does not invoke exit(); it invokes my own
function (which is defined as noreturn, but that's not required).
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85783
--- Comment #4 from Paul Smith ---
Well, clearly I disagree with this conclusion and feel this is a bug.
At the very least, the fact that it's impossible to disable the warning needs
to be considered a bug. The statement on the mailing list
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85783
Martin Sebor changed:
What|Removed |Added
Keywords||diagnostic
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85783
--- Comment #2 from Paul Smith ---
> Did you try: -Wno-alloc-size-larger-than ?
Yes.
cc1plus: error: unrecognized command line option
'-Wno-alloc-size-larger-than'
> Also in your code, numberFields is a signed int and then casted to size_t.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85783
--- Comment #1 from Andrew Pinski ---
Did you try:
-Wno-alloc-size-larger-than ?
Also in your code, numberFields is a signed int and then casted to size_t. On
LP64 targets (or rather sizeof(size_t) != sizeof(int)), then value is sign
extended.
12 matches
Mail list logo