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

bluegr noreply at scummvm.org
Wed May 21 07:20:33 UTC 2025


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

Summary:
3e33c8908d JANITORIAL: Remove recently-added warning suppression pragmas
e472be2ee4 BUILD: Suppress stringop-overflow and stringop-truncation GCC warnings


Commit: 3e33c8908d6eaaa20c65065a665cc0b27ff1f8f4
    https://github.com/scummvm/scummvm/commit/3e33c8908d6eaaa20c65065a665cc0b27ff1f8f4
Author: Orgad Shaneh (orgads at gmail.com)
Date: 2025-05-21T10:20:29+03:00

Commit Message:
JANITORIAL: Remove recently-added warning suppression pragmas

This reverts commits c613f2d4794, 03790b13500 and part of
fc71b779a5a.

Changed paths:
    engines/alg/logic/game_bountyhunter.cpp
    engines/grim/lua/lstrlib.cpp
    engines/scumm/players/player_sid.cpp


diff --git a/engines/alg/logic/game_bountyhunter.cpp b/engines/alg/logic/game_bountyhunter.cpp
index dabb5a1fa8d..c30f9c9f26f 100644
--- a/engines/alg/logic/game_bountyhunter.cpp
+++ b/engines/alg/logic/game_bountyhunter.cpp
@@ -30,10 +30,6 @@
 #include "alg/logic/game_bountyhunter.h"
 #include "alg/scene.h"
 
-#if defined(__GNUC__) && !defined(__clang__)
-#pragma GCC diagnostic ignored "-Wstringop-overflow"
-#endif
-
 namespace Alg {
 
 GameBountyHunter::GameBountyHunter(AlgEngine *vm, const AlgGameDescription *gd) : Game(vm) {
diff --git a/engines/grim/lua/lstrlib.cpp b/engines/grim/lua/lstrlib.cpp
index dec30476adc..76a30f76805 100644
--- a/engines/grim/lua/lstrlib.cpp
+++ b/engines/grim/lua/lstrlib.cpp
@@ -15,18 +15,11 @@
 
 namespace Grim {
 
-#if defined(__GNUC__) && !defined(__clang__)
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wstringop-truncation"
-#endif
 static void addnchar(const char *s, int32 n) {
 	char *b = luaL_openspace(n);
 	strncpy(b, s, n);
 	luaL_addsize(n);
 }
-#if defined(__GNUC__) && !defined(__clang__)
-#pragma GCC diagnostic pop
-#endif
 
 static void addstr(const char *s) {
 	addnchar(s, strlen(s));
diff --git a/engines/scumm/players/player_sid.cpp b/engines/scumm/players/player_sid.cpp
index 4e0ce84be8b..b6a818d199b 100644
--- a/engines/scumm/players/player_sid.cpp
+++ b/engines/scumm/players/player_sid.cpp
@@ -26,10 +26,6 @@
 
 #ifdef USE_SID_AUDIO
 
-#if defined(__GNUC__) && !defined(__clang__)
-#pragma GCC diagnostic ignored "-Wstringop-overflow"
-#endif
-
 namespace Scumm {
 
 /*


Commit: e472be2ee48ef4245eedb85a9cbd1651917fb668
    https://github.com/scummvm/scummvm/commit/e472be2ee48ef4245eedb85a9cbd1651917fb668
Author: Orgad Shaneh (orgads at gmail.com)
Date: 2025-05-21T10:20:29+03:00

Commit Message:
BUILD: Suppress stringop-overflow and stringop-truncation GCC warnings

Too many false-positives.

Changed paths:
    configure
    devtools/create_project/cmake.cpp


diff --git a/configure b/configure
index 551d5013b27..565aeedcf13 100755
--- a/configure
+++ b/configure
@@ -2383,6 +2383,12 @@ if test "$have_gcc" = yes; then
 
 		if test $_cxx_major -ge 5; then
 			append_var CXXFLAGS "-Wshadow"
+			if test $_cxx_major -ge 7; then
+				append_var CXXFLAGS "-Wno-stringop-overflow"
+				if test $_cxx_major -ge 8; then
+					append_var CXXFLAGS "-Wno-stringop-truncation"
+				fi
+			fi
 		else
 			append_var CXXFLAGS "-Wno-missing-field-initializers"
 
diff --git a/devtools/create_project/cmake.cpp b/devtools/create_project/cmake.cpp
index e8394dc6c62..1d436c1a270 100644
--- a/devtools/create_project/cmake.cpp
+++ b/devtools/create_project/cmake.cpp
@@ -349,8 +349,16 @@ void CMakeProvider::writeWarnings(std::ofstream &output) const {
 		output << ' ' << warning;
 	}
 	output << "\")\n";
-	output << "\tif(CMAKE_CXX_COMPILER_ID STREQUAL \"GNU\" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 12.0)\n";
-	output << "\t\tset(CMAKE_CXX_FLAGS \"${CMAKE_CXX_FLAGS} -Wno-address-of-packed-member\")\n";
+	output << "\tif(CMAKE_CXX_COMPILER_ID STREQUAL \"GNU\")\n";
+	output << "\t\tif(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 7.1)\n";
+	output << "\t\t\tset(CMAKE_CXX_FLAGS \"${CMAKE_CXX_FLAGS} -Wno-stringop-overflow\")\n";
+	output << "\t\tendif()\n";
+	output << "\t\tif(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 8.1)\n";
+	output << "\t\t\tset(CMAKE_CXX_FLAGS \"${CMAKE_CXX_FLAGS} -Wno-stringop-truncation\")\n";
+	output << "\t\tendif()\n";
+	output << "\t\tif(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 12.0)\n";
+	output << "\t\t\tset(CMAKE_CXX_FLAGS \"${CMAKE_CXX_FLAGS} -Wno-address-of-packed-member\")\n";
+	output << "\t\tendif()\n";
 	output << "\tendif()\n";
 	output << "endif()\n";
 }




More information about the Scummvm-git-logs mailing list