public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: Aurel Balmosan <ab@orga.com>
To: egcs-bugs <egcs-bugs@cygnus.com>
Subject: Initialising an union
Date: Tue, 18 Aug 1998 00:39:00 -0000	[thread overview]
Message-ID: <35D92F35.280D31A1@orga.com> (raw)

Hello,

I noticed a problem while initialising an union.
Here a test source:

struct a {
        int a;
};

struct b {
        int a;
        double b;
};

struct c {
        int a;
        double b;
        char c[16];
};

union x {
        int a;
        struct a as;
        struct b bs;
        struct c cs;
};

void test()
{       union x X = { 0 };
        for(;;);
        X.a++;
}

void main()
{       char    c[]="1123124213";
        test();

}

You will notice that the union X is not fully initialised. At least I noticed
that
on DecUNIX-4.0b (4.0d) Solaris-2.5.1 with the egcs version

  egcs-2.90.29 980515 (egcs-1.0.3 release)

--
Aurel Balmosan           | Department SE-SW
ORGA Kartensysteme GmbH  | phone: +49 5254 991 824
An der Kapelle 2         | fax  : +49 5254 991 749
33104 Paderborn, Germany | mailto:ab@orga.com





             reply	other threads:[~1998-08-18  0:39 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-08-18  0:39 Aurel Balmosan [this message]
1998-08-18 18:14 ` Alexandre Oliva
1998-08-19  2:44   ` Aurel Balmosan
1998-08-19 14:51     ` Alexandre Oliva
1998-08-20  2:41       ` Aurel Balmosan
1998-08-20  8:15         ` Alexandre Oliva
  -- strict thread matches above, loose matches on Subject: below --
1998-08-17  7:51 Aurel Balmosan
1998-08-18 11:46 ` Jeroen Dobbelaere
1998-08-19  4:40   ` Aurel Balmosan
1998-08-19 10:03     ` Jeroen Dobbelaere

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=35D92F35.280D31A1@orga.com \
    --to=ab@orga.com \
    --cc=egcs-bugs@cygnus.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).