From: "Adam Powers" <apowers@telocity.net>
To: help-gcc@gnu.org
Subject: structure initialization strangeness
Date: Sat, 18 Dec 1999 16:44:00 -0000 [thread overview]
Message-ID: <rSV64.52$yh.653@newsrump.sjc.telocity.net> (raw)
the code below causes the structure "duiTest_dui_dev" to be initialized to
all 0s. is this a bug in gcc, or a misconception on my part of how partial
strucutre initialization works?
i'm using gcc version cygnus-2.7.2-960126.
thanks in advance,
-A
typedef struct dui_usr_struct {
char *desc;
unsigned int type;
unsigned int speed;
unsigned int bufSz;
} DUI_USR;
typedef struct dui_dev_struct {
END_OBJ end;
char *duiName;
unsigned int duiUnit;
char enetAddr[6];
END_OBJ * (*loadRtn) (char *, void *);
DUI_USR usr;
} DUI_DEV;
DUI_DEV duiTest_dui_dev = {
duiName:"duiTest2",
duiUnit:0,
loadRtn:duiTestLoad,
usr:{"DUI Test Device", 1, 1000000, 1514}
};
WARNING: multiple messages have this Message-ID
From: "Adam Powers" <apowers@telocity.net>
To: help-gcc@gnu.org
Subject: structure initialization strangeness
Date: Fri, 31 Dec 1999 22:24:00 -0000 [thread overview]
Message-ID: <rSV64.52$yh.653@newsrump.sjc.telocity.net> (raw)
Message-ID: <19991231222400.NGKEJpCE6HbFyym-gzke3Ar0qD9rfP-VE4q0zkr3Xps@z> (raw)
the code below causes the structure "duiTest_dui_dev" to be initialized to
all 0s. is this a bug in gcc, or a misconception on my part of how partial
strucutre initialization works?
i'm using gcc version cygnus-2.7.2-960126.
thanks in advance,
-A
typedef struct dui_usr_struct {
char *desc;
unsigned int type;
unsigned int speed;
unsigned int bufSz;
} DUI_USR;
typedef struct dui_dev_struct {
END_OBJ end;
char *duiName;
unsigned int duiUnit;
char enetAddr[6];
END_OBJ * (*loadRtn) (char *, void *);
DUI_USR usr;
} DUI_DEV;
DUI_DEV duiTest_dui_dev = {
duiName:"duiTest2",
duiUnit:0,
loadRtn:duiTestLoad,
usr:{"DUI Test Device", 1, 1000000, 1514}
};
next reply other threads:[~1999-12-18 16:44 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
1999-12-18 16:44 Adam Powers [this message]
1999-12-31 22:24 ` Adam Powers
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='rSV64.52$yh.653@newsrump.sjc.telocity.net' \
--to=apowers@telocity.net \
--cc=help-gcc@gnu.org \
/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).