This is the mail archive of the gcc-help@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]

Documentation error or what am I missing?


Hi folks,

over at <http://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html> one
can read the following:

----
malloc
The malloc attribute is used to tell the compiler that a function may be
treated as if any non-NULL pointer it returns cannot alias any other
pointer valid when the function returns and that the memory has
undefined content. This will often improve optimization. Standard
functions with this property include malloc and calloc. realloc-like
functions do not have this property as the memory pointed to does not
have undefined content.
---

I'm confused about the mentioning of calloc() in this place. Isn't it
one of the semantic differences between malloc() and calloc() that the
buffer whose address is returned by calloc() is zero-initialized?

Thanks in advance for any insights,

// Oliver

Attachment: signature.asc
Description: OpenPGP digital signature


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