Skip to content

fix(mk): a warned assembly must not fail the build - #94

Merged
mgrossmann merged 1 commit into
mainfrom
fix/tolerate-assembler-warnings
Aug 28, 2026
Merged

fix(mk): a warned assembly must not fail the build#94
mgrossmann merged 1 commit into
mainfrom
fix/tolerate-assembler-warnings

Conversation

@mgrossmann

@mgrossmann mgrossmann commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

as370 returns IFOX00's severity as its exit status — 0 clean, 4 warning, 8
error, 12 severe, 16 terminal — and a warned assembly still punches its deck. On
MVS that was COND=(8,LT): the ASM step returned 4 and the linkage editor ran
anyway.

make stops on any non-zero status, so one warned card would fail a whole build
over a diagnostic the assembler itself considers survivable.

$(Q)$(AS) $(ASFLAGS) -o $@ $< || { rc=$$?; [ $$rc -lt 8 ] || exit $$rc; }

Verified: clean (RC 0) builds, warned (RC 4) builds with the diagnostic on
stderr, errored (RC 8) fails as make: *** [build/bad.o] Error 8 — the true
severity survives into make's message.

Follow-ups, after this merged

  • fix(as370): a discarded statement is an error, not a severity-4 warning cc370#84 is the necessary companion and is still open. The
    nsf370 team showed the hole this rule has on its own: IFO026 is severity 4,
    so RC < 8 swallows it — and IFO026 is not an ordinary warning, it means a
    card was eaten and the deck was punched anyway. Sent through exactly this rule,
    a re-lengthened comment card that eats a DCBD gives exit code: 0 and three
    corrupted bytes. cc370#84 splits the two cases in the assembler, where the
    distinction exists: a consumed comment stays severity 4, a consumed
    statement becomes 8. Until it lands, this rule tolerates both.
  • .DELETE_ON_ERROR: followed in c80e23c: as370 writes its deck even when it
    flags the assembly, so a build stopped at RC 8 was leaving a .o newer than
    its source, which the next make called up to date and linked.

Not addressed here

The .c rule cannot do the same: the cc370 driver treats any non-zero status
from the assembler it invokes as fatal, and that is inside the driver. Nothing
hits it today — generated assembler carries no column-72 comment cards.

as370 returns IFOX00's severity as its exit status -- 0 clean, 4 warning, 8
error, 12 severe, 16 terminal -- and a warned assembly still punches its deck.
On MVS that was COND=(8,LT): the ASM step returned 4 and the linkage editor ran
anyway.

make stops on any non-zero status, so a single warned card would fail a whole
build over a diagnostic the assembler itself considers survivable. Until now
that could not happen, because as370 had no severity-4 diagnostic at all; since
mvslovers/cc370#72 it has two (IFO026 CHARACTERS APPEAR BETWEEN THE BEGIN AND
CONTINUE COLUMNS, IFO069 TOO MANY CONTINUATION CARDS), and a comment card
reaching column 72 in any hand-written module would now stop the build.

The .asm and .s rules keep RC < 8 and re-raise anything at or above 8 with its
own code, so `make` still reports `Error 8` for a real assembly error and the
diagnostics reach stderr either way. Verified against all three cases: clean
(RC 0) builds, warned (RC 4) builds, errored (RC 8) fails with Error 8.

Not addressed here: the .c rule cannot do the same, because the cc370 driver
treats any non-zero status from the assembler it invokes as fatal. Generated
assembler carries no column-72 comment cards, so nothing hits that today.
@mgrossmann

Copy link
Copy Markdown
Contributor Author

Hold this until mvslovers/cc370#84 lands, and merge it after.

The nsf370 team showed the hole in what this PR does on its own: IFO026 is
severity 4, so RC < 8 swallows it — and IFO026 is not an ordinary warning,
it means a card was eaten and the deck was punched anyway. Sent through
exactly the rule below, a re-lengthened comment card that eats a DCBD gives
exit code: 0 and three corrupted bytes. That is the detection this PR would
have removed.

cc370#84 splits the two cases in the assembler, where the distinction actually
exists: a consumed comment card stays IFO026 at severity 4, a consumed
statement becomes severity 8. With that in place, RC < 8 here tolerates
only what is genuinely harmless — and every project gets the protection, not
just the ones that add a card-column lint.

Measured after the split: libc370 743 modules clean, rexx370 three warnings and
no new error, nsf370's two broken modules RC 8 (their fixed branch clean).

@mgrossmann mgrossmann changed the title fix(mk): a warned assembly must not fail the build fix(mk): the assembler's return code contract -- tolerate a warning, delete a failed object Aug 28, 2026
@mgrossmann mgrossmann changed the title fix(mk): the assembler's return code contract -- tolerate a warning, delete a failed object fix(mk): a warned assembly must not fail the build Aug 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant