From 08fb43aea12b2fef2d5ba4bec96286f41000e40d Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 6 Nov 2026 17:24:43 +0000 Subject: [PATCH] Watcom: blank()'s cell assigned, not initialised; build every file before stopping Open Watcom's C takes only constants in an aggregate's initialiser. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01B82eRVTPinTtLUajudobBC --- core/src/vt.c | 8 +++++++- windows/build-watcom.sh | 7 +++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/core/src/vt.c b/core/src/vt.c index 24f1a49..015d8c5 100644 --- a/core/src/vt.c +++ b/core/src/vt.c @@ -61,7 +61,13 @@ struct dmc_vt { static struct cell blank(const dmc_vt *t) { - struct cell c = { ' ', -1, t ? t->bg : -1, 0 }; + /* (assigned: C89 compilers, Watcom's, take constants only in an + initialiser) */ + struct cell c; + c.ch = ' '; + c.fg = -1; + c.bg = t ? t->bg : -1; + c.attr = 0; return c; } diff --git a/windows/build-watcom.sh b/windows/build-watcom.sh index 973e569..f0d6a0e 100755 --- a/windows/build-watcom.sh +++ b/windows/build-watcom.sh @@ -18,17 +18,20 @@ inc="-i=$WATCOM/h -i=$WATCOM/h/nt -i=$root/core/include -i=$root/core/src" copts="-q -bt=nt -bm -3r -ox -w4 -zq -za99 $inc" cppopts="-q -bt=nt -bm -3r -ox -w4 -zq -xs $inc -i=$here/src" +# every file compiled, so that one run shows all the errors objs="" +failed=0 for f in "$root"/core/src/*.c; do o=$(basename "$f" .c).obj - wcc386 $copts -fo="$o" "$f" + wcc386 $copts -fo="$o" "$f" || failed=1 objs="$objs $o" done for f in "$here"/src/*.cpp; do o=$(basename "$f" .cpp).obj - wpp386 $cppopts -fo="$o" "$f" + wpp386 $cppopts -fo="$o" "$f" || failed=1 objs="$objs $o" done +[ $failed = 0 ] || exit 1 wrc -q -r -bt=nt -i="$WATCOM/h/nt" -i="$here/src" -i="$here/res" \ -fo=app.res "$here/res/app.rc"