Skip to content

Commit

Permalink
Explicitly turn on signed overflow semantics
Browse files Browse the repository at this point in the history
Rakudo (if not Raku) assumes signed overflow, even though it's
technically undefined behavior in C. Add the '-fwrapv' flag, which AIUI
codified the behavior we expect in both GCC and Clang. This silences a
bunch of UBSAN warnings when running NQP tests.
  • Loading branch information
MasterDuke17 committed Nov 24, 2024
1 parent 79edc97 commit 6242cbb
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions Configure.pl
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,7 @@ sub uniq {
# generate CFLAGS
my @cflags;
push @cflags, '-std=c99' if $defaults{os} eq 'mingw32';
push @cflags, '-fwrapv';
push @cflags, $config{ccmiscflags};
push @cflags, $config{ccoptiflags} if $args{optimize};
push @cflags, $config{ccdebugflags} if $args{debug};
Expand Down

0 comments on commit 6242cbb

Please sign in to comment.