First of all - apologies - I said something a bit misleading.
This is hand-generated assembler, in the same STYLE
that gccmvs-generated code is in.
Regardless - yes, I used externs. And you can't have duplicate
externs - you get an error - that's exactly what I want. Instead
of a clean link (in this case with a warning), I get a hard error
with duplicate externs.
If I have a function verylongOne and verylongTwo, both
will be truncated by gccmvs to VERYLONG and if I use
externs instead of named csects, I get notified of the clash.
The behavior of z390 below - having $PRIVATE behave the
same as other CSECTs on MVS - ie, the largest csect wins
(actually, z390 is a bit different - the last wins) differs from
MVS. On MVS, $PRIVATE is special - they are all used,
instead of having the largest win.
BFN. Paul.
On Mon, Aug 18, 2025 at 8:09 AM Jon Perryman <
jon.pe...@gmail.com> wrote:
>
> I asked because you say you have multiple unnamed csects that link without a problem but won't run correctly. Since you can't access the unnamed csects directly, I assume you're using EXTRNs, possibly WXTRNs. Since you can't generate unique csect names, how are you generating unique EXTRNs? I'm guessing they are not unique and the wrong EXTRN is being called. The link output should show references. You could insert WTO in each csect that identifies when it is called. In other words, I think you have 3 unnamed csects with EXTERN AAA and 3 V(AAA) that all reference the first EXTRN and ignore the other 2.
>
> On Sun, Aug 17, 2025 at 4:36 PM Paul Edwards <
muta...@gmail.com> wrote:
>>
>> The code in question will be generated by the C compiler (gccmvs).
>>
>> Even IBM C doesn't have the ability to automatically name CSECTs.
>>
>> Note that if I changed gccmvs to attempt to automatically create
>> a CSECT name based on some factor like the function name,
>> then if there is a name clash, I am not alerted to that fact. Instead,
>> the biggest CSECT silently takes effect. A terrible situation.
>>
>> I consider THAT to be the bad practice.
>>
>> YMMV and I'm not asking you to stop naming CSECTs. :-)
>>
>> BFN. Paul.
>>
>>
>>
>>
>> On Mon, Aug 18, 2025 at 7:29 AM Jon Perryman <
jon.pe...@gmail.com> wrote:
>> >
>> > Paul, do you have a real need for not naming csects? This is a bad practice.
>> >> To view this discussion visit
https://groups.google.com/d/msgid/z390/8302728e-4f91-4387-8be0-ed37b78d6969n%40googlegroups.com.