https://gitlab.synchro.net/main/sbbs/-/commit/19b386cb5ca8a2c38f5b88f3
Modified Files:
src/sbbs3/sbbsdefs.h
Log Message:
Use 1U for QHUB_NATIVE, the only bit-31 macro in sbbsdefs.h without it
"1 << 31" shifts into the sign bit of an int, which is undefined
behavior. It has worked everywhere we build because GCC and MSVC both
yield INT_MIN and qhub_t.misc is uint32_t, so the conversion lands on 0x80000000 either way, but there is no reason to keep relying on that.
UBSan flags it; -Wall -Wextra does not, which is why it went unnoticed
when the bit moved to 31 in 0bc7b3297e (cleaning-19-wish, 2026-01-31).
Every other bit-31 macro in this header already uses 1U: SM_SYSVDELM, XTRN_CONIO, CON_CR_CLREOL, MOUSE, SS_FASTLOGON and EX_CONIO.
Value-preserving: both forms give 0x80000000 for the "misc ^=" in
scfgnet.c and the "misc &" test in main.cpp, verified against each other,
and both consumers plus msgtoqwk.cpp still compile clean.
Co-Authored-By: Claude Opus 5 (1M context) <
noreply@anthropic.com>
---
þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net