From owner-freebsd-hackers Tue Aug 4 12:51:18 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id MAA13980 for freebsd-hackers-outgoing; Tue, 4 Aug 1998 12:51:18 -0700 (PDT) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from rover.village.org (rover.village.org [204.144.255.49]) by hub.freebsd.org (8.8.8/8.8.8) with SMTP id MAA13973 for ; Tue, 4 Aug 1998 12:51:11 -0700 (PDT) (envelope-from imp@village.org) Received: from harmony [10.0.0.6] by rover.village.org with esmtp (Exim 1.71 #1) id 0z3n6h-0006yv-00; Tue, 4 Aug 1998 13:50:51 -0600 Received: from harmony.village.org (localhost.village.org [127.0.0.1]) by harmony.village.org (8.8.8/8.8.3) with ESMTP id NAA18579; Tue, 4 Aug 1998 13:50:49 -0600 (MDT) Message-Id: <199808041950.NAA18579@harmony.village.org> To: Nicolas Souchu Subject: Re: C and static initialization with unions Cc: FreeBSD Hackers In-reply-to: Your message of "Tue, 04 Aug 1998 18:59:38 -0000." <19980804185938.36803@breizh.prism.uvsq.fr> References: <19980804185938.36803@breizh.prism.uvsq.fr> Date: Tue, 04 Aug 1998 13:50:49 -0600 From: Warner Losh Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG In message <19980804185938.36803@breizh.prism.uvsq.fr> Nicolas Souchu writes: : static union foo_t bar = { (void *)&anyvar }; : : The compiler says "warning, making integer from pointer without a cast"... : Which is true and could lead to bad asm code. static union foo_t bar = { (int)(void *)&anyvar }; But it is unwise to assume that sizeof(int) == sizeof(void *). Warner To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message