[Scummvm-git-logs] scummvm master -> ca88e7fc33a87c73e75fab52f67b797db043e913

bluegr noreply at scummvm.org
Sat Nov 29 21:42:11 UTC 2025


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .

Summary:
ca88e7fc33 GRIM: LUA: Fix lua_error() 'noreturn' warning on some platforms


Commit: ca88e7fc33a87c73e75fab52f67b797db043e913
    https://github.com/scummvm/scummvm/commit/ca88e7fc33a87c73e75fab52f67b797db043e913
Author: Donovan Watteau (contrib at dwatteau.fr)
Date: 2025-11-30T05:42:06+08:00

Commit Message:
GRIM: LUA: Fix lua_error() 'noreturn' warning on some platforms

Since lua_error() has been marked noreturn in commit 6caf974783dc977139e061b1e1624637c8ebcaef,
some compilers/environments (such as GCC 7.5.0 on OSX 10.4) may report
that it "does return", around the longjmp() call.

Help compilers understand that lua_error() will indeed never return to
its caller, by just calling exit(1) in all cases.

Changed paths:
    engines/grim/lua/ldo.cpp


diff --git a/engines/grim/lua/ldo.cpp b/engines/grim/lua/ldo.cpp
index 1d2a309bfd2..7729a81f175 100644
--- a/engines/grim/lua/ldo.cpp
+++ b/engines/grim/lua/ldo.cpp
@@ -311,8 +311,8 @@ void lua_error(const char *s) {
 		longjmp(*((jmp_buf *)lua_state->errorJmp), 1);
 	} else {
 		fprintf(stderr, "lua: exit(1). Unable to recover\n");
-		exit(1);
 	}
+	exit(1); // exit in both cases, to help compilers with noreturn/longjmp
 }
 
 /*




More information about the Scummvm-git-logs mailing list