From owner-freebsd-current@FreeBSD.ORG Wed Apr 2 19:30:54 2014 Return-Path: Delivered-To: freebsd-current@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C8A8DA57 for ; Wed, 2 Apr 2014 19:30:54 +0000 (UTC) Received: from theravensnest.org (theraven.freebsd.your.org [216.14.102.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "theravensnest.org", Issuer "theravensnest.org" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 8E19FEF for ; Wed, 2 Apr 2014 19:30:54 +0000 (UTC) Received: from [192.168.0.100] (cpc14-cmbg15-2-0-cust307.5-4.cable.virginm.net [82.26.1.52]) (authenticated bits=0) by theravensnest.org (8.14.7/8.14.7) with ESMTP id s32JUo6k058051 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Wed, 2 Apr 2014 19:30:52 GMT (envelope-from theraven@FreeBSD.org) Content-Type: text/plain; charset=iso-8859-1 Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) Subject: Re: gcc compilation broken with SVN r264042 From: David Chisnall In-Reply-To: <533C61B8.7060809@protected-networks.net> Date: Wed, 2 Apr 2014 20:30:45 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: <509CAA08-8F00-4ED8-81FF-A51F1ECDC15C@FreeBSD.org> References: <533C61B8.7060809@protected-networks.net> To: Michael Butler X-Mailer: Apple Mail (2.1874) Cc: FreeBSD Current X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Apr 2014 19:30:54 -0000 Hi, I'm trying to reproduce this, but I don't seem to be able to get the = same error as you. I do get a warning with GCC about a cast to an = anonymous struct, which the attached patch fixes, but even without this = I'm able to build both with the gcc in 9 and the gcc in ports. Can you = let me know your gcc version? Unfortunately, the gcc error reporting = isn't very helpful, so I don't know what it thinks it can't convert to a = pointer type. It would be great if you could try this patch, and if = that doesn't fix it then try splitting the casts and dereferences into = separate lines and see which part of this it is the gcc doesn't like. =20= David Index: include/block_abi.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- include/block_abi.h (revision 264042) +++ include/block_abi.h (working copy) @@ -50,14 +50,16 @@ } *name #define CALL_BLOCK(name, ...) (name)->invoke(name, __VA_ARGS__) #endif // __BLOCKS__ +struct generic_block +{ + void *isa; + int flags; + int reserved; + void (*invoke)(void *, ...); +}; /** * Returns the pointer to the block-invoke function. This is used for = passing * blocks to functions that want a function pointer and a data pointer. */ #define GET_BLOCK_FUNCTION(x) \ - (((struct {\ - void *isa;\ - int flags;\ - int reserved;\ - void (*invoke)(void *, ...);\ - }*)x)->invoke) + (((struct generic_block*)x)->invoke) On 2 Apr 2014, at 20:15, Michael Butler = wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 >=20 > Seems that GCC doesn't like/understand the cast .. >=20 > imb@mail:/usr/src/lib/libc> sudo make > cc -O2 -pipe -march=3Dpentium4 -I/usr/src/lib/libc/include > - -I/usr/src/lib/libc/../../include -I/usr/src/lib/libc/i386 -DNLS > - -D__DBINTERFACE_PRIVATE -I/usr/src/lib/libc/../../contrib/gdtoa > - -I/usr/src/lib/libc/../../contrib/libc-vis -DINET6 > - -I/usr/obj/usr/src/lib/libc -I/usr/src/lib/libc/resolv = -D_ACL_PRIVATE > - -DPOSIX_MISTAKE -I/usr/src/lib/libc/../../contrib/jemalloc/include > - -DMALLOC_PRODUCTION -I/usr/src/lib/libc/../../contrib/tzcode/stdtime > - -I/usr/src/lib/libc/stdtime -I/usr/src/lib/libc/locale -DBROKEN_DES > - -DPORTMAP -DDES_BUILTIN -I/usr/src/lib/libc/rpc -DYP -DNS_CACHING > - -DSYMBOL_VERSIONING -std=3Dgnu99 -fstack-protector -Wsystem-headers > - -Werror -Wall -Wno-format-y2k -Wno-uninitialized -Wno-pointer-sign = -c > /usr/src/lib/libc/stdlib/atexit.c -o atexit.o > /usr/src/lib/libc/stdlib/atexit.c: In function 'atexit_b': > /usr/src/lib/libc/stdlib/atexit.c:157: error: cannot convert to a > pointer type > *** Error code 1 >=20 > Stop. > make: stopped in /usr/src/lib/libc > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1 >=20 > iEYEARECAAYFAlM8YbcACgkQQv9rrgRC1JIucgCfRPm79qcKX9XpAfazKfGRsOry > lOAAnRiHdpdRzLS5MtC7YPOsNeWZtiBS > =3D2y7B > -----END PGP SIGNATURE-----