Browse Source

Pass -fwrapv option to compiler

espeak source code uses signed integer wrapping (e.g. wavephase in
wavegen.c's Wavegen). It happens that this is undefined behavior, so a
compiler would be free optimize away various situations... Fortunately gcc
has an -fwrapv option to make signed integer wrapping defined.

Options would be needed for other compilers.
master
Samuel Thibault 3 years ago
parent
commit
3b8eeb2f7b
1 changed files with 9 additions and 0 deletions
  1. 9
    0
      configure.ac

+ 9
- 0
configure.ac View File

@@ -311,6 +311,15 @@ AX_CHECK_COMPILE_FLAG([-Wuninitialized], [CFLAGS="-Wuninitialized $CFLAG
AX_CHECK_COMPILE_FLAG([-Wunused], [CFLAGS="-Wunused $CFLAGS"])
AX_CHECK_COMPILE_FLAG([-Wunused-parameter], [CFLAGS="-Wunused-parameter $CFLAGS"])


dnl ================================================================
dnl Enable two-complement signed integer wrapping
dnl
dnl Otherwise this is undefined behavior.
dnl ================================================================

AX_CHECK_COMPILE_FLAG([-fwrapv], [CFLAGS="-fwrapv $CFLAGS"])

dnl ================================================================
dnl libFuzzer checks.
dnl ================================================================

Loading…
Cancel
Save