This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix PR c/14411


On Mon, 22 Nov 2004, Zack Weinberg wrote:

> Calling it "attribute malloc" is somewhat better motivated - all
> functions to which attribute malloc might reasonably be applied, have
> a broad category of properties in common with malloc itself.  We
> happen only to use the one property that the pointer it returns cannot
> alias anything at that point, but we could use others (for instance, I
> personally think it would be reasonable to optimize out a call to
> malloc if its return value was discarded - others may dispute this).

I did in fact document the specific meaning of attribute malloc when this 
was queried in bug 3414.  But malloc seems more closely tied to the 
meaning of "returns new memory" than setjmp is to "returns twice", 
especially given the otherwise unrelated vfork which shares that property.

-- 
Joseph S. Myers               http://www.srcf.ucam.org/~jsm28/gcc/
    jsm@polyomino.org.uk (personal mail)
    joseph@codesourcery.com (CodeSourcery mail)
    jsm28@gcc.gnu.org (Bugzilla assignments and CCs)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]