Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 04 Aug 1998 13:50:49 -0600
From:      Warner Losh <imp@village.org>
To:        Nicolas Souchu <Nicolas.Souchu@prism.uvsq.fr>
Cc:        FreeBSD Hackers <freebsd-hackers@FreeBSD.ORG>
Subject:   Re: C and static initialization with unions 
Message-ID:  <199808041950.NAA18579@harmony.village.org>
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>  

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199808041950.NAA18579>