Deutsch   English   Français   Italiano  
<20241213145639.00003d71@yahoo.com>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Michael S <already5chosen@yahoo.com>
Newsgroups: comp.lang.c
Subject: Re: C89 "bug"
Date: Fri, 13 Dec 2024 14:56:39 +0200
Organization: A noiseless patient Spider
Lines: 22
Message-ID: <20241213145639.00003d71@yahoo.com>
References: <vjh8hu$3den0$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 13 Dec 2024 13:56:40 +0100 (CET)
Injection-Info: dont-email.me; posting-host="34782675bbc9c0fc7c4f5e0641ba85f0";
	logging-data="3518754"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX19sg1wFZHx9fm97kz53ov2Z0CIgFHBdmZ0="
Cancel-Lock: sha1:1YTs0uFAM2UXRMURDemE2jnhUE8=
X-Newsreader: Claws Mail 4.1.1 (GTK 3.24.34; x86_64-w64-mingw32)
Bytes: 1305

On Fri, 13 Dec 2024 09:15:58 -0300
Thiago Adams <thiago.adams@gmail.com> wrote:

> Does anyone knows how can I convert this code (external declaration)
> to C89?
> 
> union U {
>      int i;
>      double d;
> };
> 
> union U  u = {.d=1.2};
> 
> The problem is that in C89 only the first member of the union is 
> initialized.
> 

union U {
 double d;
 int i;
};