Yes. I personally use memset all the time. But this is not the point.
We have hundreds of programs in production that use this kind of
initialization.
And we don't want to check and change them all. If the IBM people are
wrong in
their interpretation of the C language definition, they should fix their
compiler,
and we would simply recompile all our programs without having to examine
them and to lookup all such declarations and initializations, which can
be costly,
given some 2000 programs and 7 millions lines of source code.
Unfortunately, I myself have only written some dozens of these 2000 C
programs :-)
(and many of these have gone through other hands through the past 15
years).
Kind regards
Bernd
McKown, John schrieb:
-----Original Message-----
From: IBM Mainframe Discussion List
[mailto:ibm-m...@bama.ua.edu] On Behalf Of Bernd Oppolzer
Sent: Tuesday, May 18, 2010 2:14 PM
To: IBM-MAIN@bama.ua.edu
Subject: partially initialized structures in C (3)
Sorry for the missing line feeds.
C statement:
* scp1215ein in1215 = { 0 };
Pseudo ASSEMBLER (structure starts at 272(r13)):
ST r6,<a5:d272:l4>(,r13,272)
MVI <a5:d276:l1>(r13,276),0
C statement:
* scp1215aus out1215 = { 0 };
Pseudo ASSEMBLER (structure starts at 296(r13)):
ST r6,<a5:d296:l4>(,r13,296)
MVI <a5:d300:l1>(r13,300),0
Kind regards
Bernd
Just me (and I'm not really good with C), but why not just use memset()?
memset(&in1215,0,sizeof in1215);
--
John McKown
Systems Engineer IV
IT
Administrative Services Group
HealthMarkets(r)
9151 Boulevard 26 * N. Richland Hills * TX 76010
(817) 255-3225 phone * (817)-961-6183 cell
john.mck...@healthmarkets.com * www.HealthMarkets.com
Confidentiality Notice: This e-mail message may contain confidential or
proprietary information. If you are not the intended recipient, please contact
the sender by reply e-mail and destroy all copies of the original message.
HealthMarkets(r) is the brand name for products underwritten and issued by the
insurance subsidiaries of HealthMarkets, Inc. -The Chesapeake Life Insurance
Company(r), Mid-West National Life Insurance Company of TennesseeSM and The
MEGA Life and Health Insurance Company.SM
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@bama.ua.edu with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@bama.ua.edu with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html