Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: GnuPG: gcrypt

grcypt.h should use __alloc_size__ attribute.

 

 

GnuPG gcrypt RSS feed   Index | Next | Previous | View Threaded


fnord.hammer at gmail

Apr 6, 2012, 8:34 AM

Post #1 of 2 (440 views)
Permalink
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 [at] gnupg
http://lists.gnupg.org/mailman/listinfo/gcrypt-devel


wk at gnupg

Apr 8, 2012, 12:16 PM

Post #2 of 2 (406 views)
Permalink
Re: grcypt.h should use __alloc_size__ attribute. [In reply to]

On Fri, 6 Apr 2012 17:34, fnord.hammer [at] gmail 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 [at] gnupg
http://lists.gnupg.org/mailman/listinfo/gcrypt-devel

GnuPG gcrypt RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.