Re: partially initialized structures in C (3)

2010-05-20 Thread Bernd Oppolzer
Hello Dave, thank you for your answers. Yes, the reason for "my" confusion was twofold: first, the documentation of IBM, which states that the remaining components of partially initialized automatic structures are not initialized, which is not conforming to the ANSI standard and is not what t

Re: partially initialized structures in C - solved

2010-05-19 Thread Hunkeler Peter (KIUP 4)
>I would kindly ask IBM to change the description in a way to be >compatible to the ANSI standard and to that what the compilers, >in fact, do. You need to send your doc change request as an RCF. Send an eMail with your comments to mhvr...@us.ibm.com I have made good experience, although it may

Re: partially initialized structures in C

2010-05-19 Thread McKown, John
> -Original Message- > From: IBM Mainframe Discussion List > [mailto:ibm-m...@bama.ua.edu] On Behalf Of Thomas David Rivers > Sent: Wednesday, May 19, 2010 8:40 AM > To: IBM-MAIN@bama.ua.edu > Subject: Re: partially initialized structures in C > > Bernd, &

Re: partially initialized structures in C (3)

2010-05-19 Thread Thomas David Rivers
Bernd Oppolzer wrote: Hello David, which version of the compiler did generate the MVC instructions? was this with or without the INITAUTO option? We use the z/OS v1.6 version, and this version only generates the MVI, not the MVCs. We will not use INITAUTO due to serious performance degradation

Re: partially initialized structures in C (3)

2010-05-19 Thread Thomas David Rivers
Hi Again Bernd, That psuedo-assembler appears to be initializing a 5-bytes of storage. Are you sure the 'scp1215ein' data type is 24 bytes? Can you show the typedef for 'scp1215ein'? Does there happen to be any packing going on? Bitfields, etc... - Dave Rivers - Bernd Oppolzer w

Re: partially initialized structures in C

2010-05-19 Thread Thomas David Rivers
Bernd, That sounds like a compiler bug, but more detail would be needed to be sure. The ANSI C standard basically works like this: A structure initialized a file scope (static or not) will be initialized to all zeros. If the structure is being initialized within a function (at a

Re: partially initialized structures in C - solved

2010-05-19 Thread Bernd Oppolzer
Hello David and all others, I have to apologize. The MVC instructions which initialize the rest of the structure come very late, some 40 instructions later, after the function prologue, so I didn't realize them. But in fact, you are right, David, they are there, and the structure is initializ

Re: partially initialized structures in C (3)

2010-05-19 Thread Miklos Szigetvari
Hi Bernd We had several PMR's about the C++ compiler and the compiler team reacted always very fast and competently (maybe as they are in Canada ;-) ) On 5/19/2010 9:21 AM, Bernd Oppolzer wrote: Hello David, which version of the compiler did generate the MVC instructions? was this with o

Re: partially initialized structures in C (3)

2010-05-19 Thread David Crayford
Bernd, I'm using z/OS V1.10 without INITAUTO. We've compiled our code all the way back to OS/390 2.8 and I can't recall ever seeing this problem. I'm sure it's a codegen bug, otherwise what is the point of the MVI? I wouldn't accept anything other than a fix from IBM. Although your compiler

Re: partially initialized structures in C (3)

2010-05-19 Thread Bernd Oppolzer
Hello David, which version of the compiler did generate the MVC instructions? was this with or without the INITAUTO option? We use the z/OS v1.6 version, and this version only generates the MVI, not the MVCs. We will not use INITAUTO due to serious performance degradation. At the moment, manag

Re: partially initialized structures in C (3)

2010-05-18 Thread Bernd Oppolzer
To David: no, there is no MVC. This is the z/OS V1.6 C-Compiler. I will try and examine the newer versions. Maybe the error is only in this version. But the description in the language reference also tells that the remaining components remain uninitialized, which is very strange. We, too, do thi

Re: partially initialized structures in C (3)

2010-05-18 Thread Charles Mills
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)): STr6,(,r13,272) MVI (r13,276),0 C statement: *scp1215aus out

Re: partially initialized structures in C (3)

2010-05-18 Thread David Crayford
Are you sure there isn't an MVC after the MVI? I rely on that kind of initialization all the time and have never had a problem. A quick test program shows the correct behavior. If this is not working as the ANSI standard I suggest you open a PMR. To circumvent the problem compile with INITAUTO(

Re: partially initialized structures in C

2010-05-18 Thread Bernd Oppolzer
Yes, with respect to the IBM description, it works correct. But the IBM description is wrong with respect to the ANSI C definition. I also checked the language references of some other compilers, that is, SGI or Microsoft. In all other cases, the remaining structure components are initialized wi

Re: partially initialized structures in C

2010-05-18 Thread McKown, John
> -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

Re: partially initialized structures in C

2010-05-18 Thread Bernd Oppolzer
ay 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)): STr6,(,r13,272) MVI (r13,276),0 C statement: *scp12

Re: partially initialized structures in C (3)

2010-05-18 Thread McKown, John
> -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 mi

partially initialized structures in C (3)

2010-05-18 Thread Bernd Oppolzer
Sorry for the missing line feeds. C statement: *scp1215ein in1215 = { 0 }; Pseudo ASSEMBLER (structure starts at 272(r13)): STr6,(,r13,272) MVI (r13,276),0 C statement: *scp1215aus out1215= { 0 }; Pseudo ASSEMBLER (structure starts at 296(r13)): STr6

partially initialized structures in C (2)

2010-05-18 Thread Bernd Oppolzer
To make it clear: *scp1215ein in1215 = { 0 }; STr6,(,r13,272) MVI (r13,276),0 *scp1215aus out1215= { 0 }; STr6,(,r13,296) MVI (r13,300)

partially initialized structures in C

2010-05-18 Thread Bernd Oppolzer
Hello all, sorry for asking this question on IBM-Main, but the C370 list is so silent that I doubt that anyone is actually listening. We observed a sort of problem today which showed up as a 0C4 abend due to a not proper initialized pointer component of a C structure. Further examination showed