Reported by GCC 12:
../scummvm/engines/glk/zcode/processor.cpp: In member function 'void Glk::ZCode::Processor::call(Glk::ZCode::zword, int, Glk::ZCode::zword*, int)':
../scummvm/engines/glk/zcode/processor.cpp:349:17: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
349 | if (h_version <= V4) // V1 to V4 games provide default
| ^~
../scummvm/engines/glk/zcode/processor.cpp:352:25: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
352 | *--_sp = (zword)((argc-- > 0) ? args[i] : value);
| ^
Reported by GCC 12:
../scummvm/engines/glk/tads/tads2/debug.cpp: In function 'int Glk::TADS::TADS2::dbgnam(dbgcxdef*, char*, int, int)':
../scummvm/engines/glk/tads/tads2/debug.cpp:158:47: warning: the address of 'Glk::TADS::TADS2::tokthdef::tokthhsh' will never be NULL [-Waddress]
158 | if (!ctx->dbgcxtab || !ctx->dbgcxtab->tokthhsh)
| ~~~~~~~~~~~~~~~^~~~~~~~
In file included from ../scummvm/engines/glk/tads/tads2/run.h:42,
from ../scummvm/engines/glk/tads/tads2/debug.cpp:24:
../scummvm/engines/glk/tads/tads2/tokenizer.h:222:19: note: 'Glk::TADS::TADS2::tokthdef::tokthhsh' declared here
222 | tokthpdef tokthhsh[TOKHASHSIZE]; /* hash table */
| ^~~~~~~~
Reported by GCC 12:
../scummvm/engines/kyra/script/script_hof.cpp: In member function 'int Kyra::KyraEngine_HoF::o2_defineSceneAnim(Kyra::EMCState*)':
../scummvm/engines/kyra/script/script_hof.cpp:875:32: warning: comparing the result of pointer addition '(((const char*)script->Kyra::EMCState::dataPtr->Kyra::EMCData::text) + ((sizetype)READ_BE_UINT16((((const void*)script->Kyra::EMCState::dataPtr->Kyra::EMCData::text) + ((sizetype)(((int)((Kyra::KyraEngine_HoF*)this)->Kyra::KyraEngine_HoF::<anonymous>.Kyra::KyraEngine_v2::<anonymous>.Kyra::KyraEngine_v1::emcSafeReadStack(script, 12, 875, ((const char*)"../scummvm/engines/kyra/script/script_hof.cpp"))) << 1))))))' and NULL [-Waddress]
875 | if (stackPosString(12) != nullptr)
../scummvm/engines/tinsel/handle.cpp: In member function 'void Tinsel::Handle::LoadFile(Tinsel::MEMHANDLE*)':
../scummvm/engines/tinsel/handle.cpp:293:27: warning: comparison of integer expressions of different signedness: 'int' and 'long unsigned int' [-Wsign-compare]
293 | if (bytes == (pH->filesize & FSIZE_MASK)) {
| ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Reported by GCC 12:
../scummvm/engines/hadesch/gfx_context.cpp: In member function 'virtual void Hadesch::GfxContext8Bit::renderToScreen(Common::Point)':
../scummvm/engines/hadesch/gfx_context.cpp:97:13: warning: the address of 'Hadesch::GfxContext8Bit::_palette' will never be NULL [-Waddress]
97 | if (_palette) {
| ^~~~~~~~
In file included from ../scummvm/engines/hadesch/gfx_context.cpp:23:
../scummvm/engines/hadesch/gfx_context.h:62:14: note: 'Hadesch::GfxContext8Bit::_palette' declared here
62 | byte _palette[256 * 4];
| ^~~~~~~~
The tray position was not correctly computed and it was most of the
time trying to display it way outside the window (it was using X
instead of Y in one place for the vertical position).
This was a recent regression from a6bc1d587 (GUI: Fixed grid view
for long games list).
Adding the sanitizer flags to the PLUGIN_LDFLAGS fixes link errors
for the plugins when asan, tsan, or ubsan is enabled.
Adding the original LDFLAGS to PLUGIN_LDFLAGS means we no longer needs
to use both in the link command for plugins.
There's still code for macOS 10.4 in the codebase, but everything before
that has probably been KO for years. And no C++11 toolchain exists for
macOS < 10.4 either.
GNU Make 3.80 is the default version on macOS Tiger, and it shouldn't be
used because it has various parsing problems and bugs.
The .FEATURES variable was added in GNU Make 3.81, and that's the
easiest and most reliable way of detecting this version.
We know that GNU Make 3.81 is OK since that's still what Apple ships
by default on modern macOS (because of GPLv3).
-mlongcall -Os would work until ScummVM 2.2.0, but now the engines are
too big to fit in a single static binary on Mac PowerPC.
(On ELF platforms, some flags like -Wl,--relax or -Wl,--gc-sections
can be used as well, but macOS uses Mach-O, and its old linker doesn't
have as many workarounds. -Wl,-dead_strip helped a bit but that's not
enough and you start hitting ld internal errors.)
So, recommend dynamic plugins on Mac PPC, now, and drop -Os -mlongcall
since working around the linker limits is not possible anymore. Using
compiler defaults probably means less bugs when using such an obscure
toolchain, anyway.
(Making a static release it still possible, but only with a very small
set of engines.)
On older macOS releases, this would leave `-e` suffixed files, and
there is no easy way to have a portable sed -i'' syntax.
Just force a creating a suffixed backup and immediately delete it.
codesign didn't exist on Tiger, and didn't have a --deep option on
Leopard.
Moreover, it was rarely used on these older systems, and previous
releases of ScummVM on Mac PowerPC weren't signed either.
We used Common::Rect which uses in16 for its members. Lomger lists
exceeded 32,768 in heights, thus, leading to negative numbers. As a result,
scrollbar was not showing up.
This is really a necessary fix, so recommended for merging before the release.
The negative global pause counter (that I really added only for the GMM/autosave situation) may not be used from within kDoSoundPause. It causes issues, the counter will go out of the expected range (also, the "Music also seems to randomly disappear when saving / restoring games" mentioned in ticket no. 13496 might be related to this).
I didn't see this, since we were focussed on SCI0. But it can be easily tested with e. g. LSL1 VGA. Just save right at the start and restore the game, it will call kDoSoundPause and trigger the issue...