From: Daniel L. <da...@ma...> - 2016-10-13 20:55:43
|
> On 8 Oct 2016, at 06:35, H. Peter Anvin <hp...@zy...> wrote: > > On 10/07/16 06:46, Daniel Lundqvist wrote: >> >> Unfortunately clang does not realise that 'again' will never be false >> for non-glibc. How do you want that fixed? Is it OK to just >> initialise f to NULL or do you prefer something else? >> > > Setting f to NULL is fine. > > From fd764d58a7ada29f5121e275ee6b1c050c5f219f Mon Sep 17 00:00:00 2001 > From: Daniel Lundqvist <da...@ma...> > Date: Fri, 7 Oct 2016 15:41:24 +0200 > Subject: [PATCH] include/compiler.h: Adapt 'malloc' attributes for clang. > > As clang does not support alloc_size attribute, don't try to use it. > > Signed-off-by: Daniel Lundqvist <da...@ma...> > > What happens if you do, given that it defined __GNUC__ and therefore > claims to be compatible with gcc? > > -hpa It gives an 'unknown attribute' warning. IIRC, clang defining __GNUC__ does not mean 100% compatibility, rather it means gcc-like. I remember reading about it, but can't find a source right now. I don't know how viable it is to use __has_attribute, at least recent versions of both gcc and clang support it. -- daniel |