Mailing List Archive

grcypt.h should use __alloc_size__ attribute.
http://gcc.gnu.org/onlinedocs/gcc-4.7.0/gcc/Function-Attributes.html#Function-Attributes

i.e

#define _GCRY_GCC_ATTR_ALLOC_SIZE(params) __attribute__
((__alloc_size__ params))

void *gcry_malloc (size_t n) _GCRY_GCC_ATTR_MALLOC
_GCRY_GCC_ATTR_ALLOC_SIZE ((1));

and so on.

_______________________________________________
Gcrypt-devel mailing list
Gcrypt-devel@gnupg.org
http://lists.gnupg.org/mailman/listinfo/gcrypt-devel
Re: grcypt.h should use __alloc_size__ attribute. [ In reply to ]
On Fri, 6 Apr 2012 17:34, fnord.hammer@gmail.com said:

> void *gcry_malloc (size_t n) _GCRY_GCC_ATTR_MALLOC
> _GCRY_GCC_ATTR_ALLOC_SIZE ((1));

I am not sure whether this is a good idea. The actually allocated
object may be larger than something allocated by malloc.


Salam-Shalom,

Werner

--
Die Gedanken sind frei. Ausnahmen regelt ein Bundesgesetz.


_______________________________________________
Gcrypt-devel mailing list
Gcrypt-devel@gnupg.org
http://lists.gnupg.org/mailman/listinfo/gcrypt-devel