I am creating several similar (but not the same) invocations of the list form of the WTO macro in the global scope of my program:
__asm(
"xxxUtilsStaticWtp WTO TEXT=*,ROUTCDE=(11),LINKAGE=,MF=L \n" // Static list form WTO
: "DS"(xxxUtilsStaticWtp) // DS name to locate list form of WTO
); ...
__asm(
"xxxUtilsStaticSWto WTO TEXT=*,ROUTCDE=(2,10),DESC=(3),LINKAGE=,MF=L \n" // Static list form WTO
: "DS"(xxxUtilsStaticSWto) // DS name to locate list form of WTO
);
(Yes, I know that one has the label inside the assembler statement declaration and one does not, it does not appear to matter either way).
When this gets compiled, the compiler emits this information about these variables:
xxxUtilsStaticSWto Class = static, Length = 256
Type = struct __ASM_DS_256
3180-10:741, 3211-10:770
xxxUtilsStaticWtp Class = static, Length = 256
Type = struct __ASM_DS_256
3089-10:650, 3136-10:695
Plus this error message:
ERROR CCN3244 XXXXX.XXXXX.H(XXXUTILS):741 External variable XXXUTILS cannot be redefined.
(Note that it works fine if one of the declarations is removed).
If I understand this correctly, the compiler is shortening the name down to eight characters (I am not using GOFF) so both of these are colliding with name XXXUTILS.
I know that I can keep other kinds of declarations at the global scope from being EXTERNAL by adding "static" to the declaration, e.g.
static int MyRoutine(int Input) { <code> }
or
static int AnInt = 5;
I spent some quality time with Inline assembly statements (IBM extension), but could not divine how to somehow squeeze the word "static" into the __asm statement or if there was another way to do it.
Anybody have any ideas on how to accomplish this?
Thank you, Scott Fagen
Ok, further investigation/playing around has lead me to believe that this might be a compiler bug. If I rename one of the DS variables from xxxUtils... to xxyUtils... everything compiles correctly. Removing the "first eight character collision" eliminates the problem (which is how I will solve it for now).
There is nothing in the assembler listing that even references xxxUtils or xxyUtils, which leads me to believe that the symbols are being somehow incorrectly tagged while the compiler is building up the information to create the $STATIC area of the module:
The xxxUtils list form WTO is at x'1D70' and the xxyUtils list form is at x'1E70'.
A search of the assembler listing for xxxUtils or xxyUtils yields nothing.
I'd expect that this is a bug of some sort...
Thanks, Scott