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 is out of support!

Quote 6.7.8.21 of the ANSI C standard which clearly states:

If there are fewer initializers in a brace-enclosed list than there are elements or members of an aggregate, or fewer characters in a string literal used to initialize an array of known size than there are elements in the array, the remainder of the aggregate shall be initialized implicitly the same as objects that have static storage duration.

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.

At the moment, management discusses the strategy to follow:

a) opening a PMR with IBM, and, if IBM agrees and changes their compilers,
recompiling all our C programs

b) accepting the behaviour of the IBM C compilers and examining
all our sources, changing all partial structure initializations to memset and, again,
recompiling all our C programs

Kind regards

Bernd



David Crayford schrieb:
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(0).

* * struct F * { * int a; * char string[20]; * short s; * }; * * struct F f = {0}; LA r0,0 ST r0,f.F.a(,r4,2016) MVI f(r4,2020),0 MVC f(23,r4,2021),f(r4,2020)

Compiled with CHECKOUT compiler option generates the following message.

INFORMATIONAL CCN3447 DOC.C(F1):14 The member(s) starting from "string" will be initialized with a default value of 0.



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

Reply via email to