Skip to content

Commit 3303b02

Browse files
committed
gh-108562: fix compiler warnings for bundled libmpdec in the main
This patch enable (if awailable) -fstrict-overflow for libmpdec and also shut off false positive warnings (-Warray-bounds). The later part was backported from mpdecimal-4.0.0.
1 parent a768e12 commit 3303b02

File tree

4 files changed

+14
-1
lines changed

4 files changed

+14
-1
lines changed

Makefile.pre.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -937,7 +937,7 @@ python.worker.js: $(srcdir)/Tools/wasm/python.worker.js
937937

938938
##########################################################################
939939
# Build static libmpdec.a
940-
LIBMPDEC_CFLAGS=@LIBMPDEC_CFLAGS@ $(PY_STDMODULE_CFLAGS) $(CCSHARED)
940+
LIBMPDEC_CFLAGS=$(PY_STDMODULE_CFLAGS) @LIBMPDEC_CFLAGS@ $(CCSHARED)
941941

942942
# "%.o: %c" is not portable
943943
Modules/_decimal/libmpdec/basearith.o: $(srcdir)/Modules/_decimal/libmpdec/basearith.c $(LIBMPDEC_HEADERS) $(PYTHON_HEADERS)

Modules/_decimal/libmpdec/io.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
#if defined(__GNUC__) && !defined(__INTEL_COMPILER) && __GNUC__ >= 7
4949
#pragma GCC diagnostic ignored "-Wimplicit-fallthrough"
5050
#pragma GCC diagnostic ignored "-Wmisleading-indentation"
51+
#pragma GCC diagnostic ignored "-Warray-bounds"
5152
#endif
5253

5354

configure

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

configure.ac

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3744,6 +3744,11 @@ AS_VAR_IF([with_system_libmpdec], [yes], [
37443744
LIBMPDEC_LDFLAGS="-lm \$(LIBMPDEC_A)"
37453745
LIBMPDEC_INTERNAL="\$(LIBMPDEC_HEADERS) \$(LIBMPDEC_A)"
37463746
3747+
dnl see GH-108562
3748+
AS_VAR_IF([ac_cv_cc_supports_fstrict_overflow], [yes], [
3749+
AS_VAR_APPEND([LIBMPDEC_CFLAGS], [" -fstrict-overflow"])
3750+
])
3751+
37473752
dnl Disable forced inlining in debug builds, see GH-94847
37483753
AS_VAR_IF([with_pydebug], [yes], [
37493754
AS_VAR_APPEND([LIBMPDEC_CFLAGS], [" -DTEST_COVERAGE"])

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy