> -----Original Message-----
> From: IBM Mainframe Discussion List 
> [mailto:ibm-m...@bama.ua.edu] On Behalf Of Bernd Oppolzer
> Sent: Tuesday, May 18, 2010 2:27 PM
> To: IBM-MAIN@bama.ua.edu
> Subject: Re: partially initialized structures in C
> 
> 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

Well, from my reading of the IBM manual, it specifically states that:

<quote>
You do not have to initialize all members of a structure or union; the
initial value of uninitialized structure members depends on the storage
class associated with the structure or union variable. In a structure
declared as static, any members that are not initialized are implicitly
initialized to zero of the appropriate type; the members of a structure
with automatic storage have no default initialization.
</quote>

I think this means that it is WAD (or BAD - Broken As Designed). You'd need IBM 
to agree to fix the compiler. I can't tell because I don't have a copy of the 
actual ANSI C reference. Oh, are you running with C99? I.e. LANGLVL(EXTENDED)? 
I don't know if that would make a difference or not. I don't have the C 
compiler here.

--
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

Reply via email to