From owner-freebsd-hackers Tue Aug 4 10:38:34 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id KAA19640 for freebsd-hackers-outgoing; Tue, 4 Aug 1998 10:38:34 -0700 (PDT) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from soleil.uvsq.fr (soleil.uvsq.fr [193.51.24.1]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id KAA19573 for ; Tue, 4 Aug 1998 10:38:10 -0700 (PDT) (envelope-from son@cezanne.prism.uvsq.fr) Received: from cezanne.prism.uvsq.fr (rtc104.reseau.uvsq.fr [193.51.24.20]) by soleil.uvsq.fr (8.9.1/jtpda-5.3.1) with ESMTP id TAA11234 for ; Tue, 4 Aug 1998 19:37:51 +0200 (METDST) Received: (from son@localhost) by cezanne.prism.uvsq.fr (8.8.8/8.8.5) id SAA05362; Tue, 4 Aug 1998 18:59:38 GMT Message-ID: <19980804185938.36803@breizh.prism.uvsq.fr> Date: Tue, 4 Aug 1998 18:59:38 +0000 From: Nicolas Souchu To: FreeBSD Hackers Subject: C and static initialization with unions Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.81e X-Operating-System: FreeBSD breizh 3.0-CURRENT FreeBSD 3.0-CURRENT Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Hi there, A question about C and static initialization of unions: suppose, union foo_t { int i; char c; void *p; }; 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. Is there a way to do this properly? Should I forgive unions or what else? -- Nicolas.Souchu@prism.uvsq.fr FreeBSD - Turning PCs into workstations - http://www.FreeBSD.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message