Skip to content

Commit

Permalink
set -fwrapv on by default unconditionally
Browse files Browse the repository at this point in the history
This was broken on gcc 10, and we want -fwrapv for all versions of
gcc that we support.

We also want a developer to be able to disable it easily
(GCCWRAPV=undef) so it remains a flag rather than hard-coding
-frwapv below.
  • Loading branch information
tonycoz committed May 10, 2021
1 parent 1e43c13 commit 4ca04a7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions win32/GNUmakefile
Expand Up @@ -583,10 +583,11 @@ MINIBUILDOPT += -D__USE_MINGW_ANSI_STDIO
endif


# If you are using GCC, 4.3 or later by default we add the -fwrapv option.
# By default add -fwrapv, since we depend on 2's complement behaviour
# for signed numbers.
# See https://github.com/Perl/perl5/issues/13690
#
GCCWRAPV := $(shell if "$(GCCVER1)"=="4" (if "$(GCCVER2)" geq "3" echo define) else if "$(GCCVER1)" geq "5" (echo define))
GCCWRAPV := define

ifeq ($(GCCWRAPV),define)
BUILDOPT += -fwrapv
Expand Down

0 comments on commit 4ca04a7

Please sign in to comment.