This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [RFC] Marking C++ new operator as malloc?
Martin Jambor <jamborm@matfyz.cz> writes:
[...]
| The reason why I believe the patch is safe not only in practice but
| also in principle
However, I do not believe it is sufficient. The reason being that
if the user does not include a header that pulls in that declaration,
then that 'malloc' attribute will be in effect.
The abstract semantics is that replaceable `operator new' functions
are implicitly declared in *every* translation unit -- and that is
what GCC does --, and you should have those implicit declarations
carry the attributes, not just the one defined in libstdc++.
-- Gaby