Re: C89 "bug"

Liste des GroupesRevenir à cl c  
Sujet : Re: C89 "bug"
De : 643-408-1753 (at) *nospam* kylheku.com (Kaz Kylheku)
Groupes : comp.lang.c
Date : 13. Dec 2024, 16:01:13
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <20241213065614.739@kylheku.com>
References : 1 2 3
User-Agent : slrn/pre1.0.4-9 (Linux)
On 2024-12-13, Thiago Adams <thiago.adams@gmail.com> wrote:
unfortunately, this solution does not work if we have two objects.
>
union U {
        double d;
        int i;
  };
>
union U u1 = { .d=2.2 };
union U u2 = { .i=1   };

Idea: have several declarations of the union in different translation
units.

/* translation unit for u1 */
union U {
  double d;
  int i;
};
extern union U u1 = { 2.2 };

/* translation unit for u2 */
union U {
  int i;
  double d;
};
extern union U u2 = { 1 };

--
TXR Programming Language: http://nongnu.org/txr
Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
Mastodon: @Kazinator@mstdn.ca

Date Sujet#  Auteur
13 Dec 24 * C89 "bug"17Thiago Adams
13 Dec 24 +* Re: C89 "bug"6Michael S
13 Dec 24 i`* Re: C89 "bug"5Thiago Adams
13 Dec 24 i `* Re: C89 "bug"4Kaz Kylheku
13 Dec 24 i  `* Re: C89 "bug"3Thiago Adams
13 Dec 24 i   `* Re: C89 "bug"2bart
13 Dec 24 i    `- Re: C89 "bug"1Thiago Adams
13 Dec 24 +* Re: C89 "bug"8Keith Thompson
13 Dec 24 i`* Re: C89 "bug"7Thiago Adams
13 Dec 24 i +* Re: C89 "bug"5David Brown
13 Dec 24 i i+* Re: C89 "bug"2Thiago Adams
13 Dec 24 i ii`- Re: C89 "bug"1Thiago Adams
14 Dec 24 i i`* Re: C89 "bug"2bart
15 Dec 24 i i `- Re: C89 "bug"1David Brown
13 Dec 24 i `- Re: C89 "bug"1Keith Thompson
14 Dec 24 `* Re: C89 "bug"2Waldek Hebisch
14 Dec 24  `- Re: C89 "bug"1Keith Thompson

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal