From: Daniel L. <da...@ma...> - 2016-10-13 21:00:38
|
> On 8 Oct 2016, at 06:39, H. Peter Anvin <hp...@zy...> wrote: > > On 10/07/16 21:35, H. Peter Anvin wrote: >> >> What happens if you do, given that it defined __GNUC__ and therefore >> claims to be compatible with gcc? >> > > +#if defined(__clang__) > +# define never_null __attribute__((returns_nonnull)) > +# define safe_alloc never_null __attribute__((malloc)) > +# define safe_malloc(s) > +# define safe_malloc2(s1,s2) > +# define safe_realloc(s) > > The latter should be safe_alloc and never_null as appropriate, though, > even if alloc_size() isn't defined. Here is an updated patch, I somehow missed those uses. Thanks for catching that. > Alternatively, we could define allocsize() as a macro... but that's > probably more trouble than it's worth. I opted for simplicity now. I suppose this can be changed later on if needed. -- daniel |