These are global arrays reused several times. When using them msan and
valgrind thus believe they are always initialized, which reduces their
capacity to detect uninitialized values. We can however explicitly tell them
when they are reused, and thus to be considered as uninitialized.
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.
without this fix (assuming it does, what the original author intended to check for), the configure script spits out an error:
checking for ndk-build no
checking for gradle no
${_source}/configure: line 13806: 0: command not found
checking if zsp-gcc supports C99 without any flags yes
checking if zsp-gcc supports C99 with the -std=c99 flag yes
that's because the condition in AM_CONDITIONAL is expected to be a valid shell expression for an if-statement, not just plain value:
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for gradle" >&5
printf %s "checking for gradle... " >&6; }
if test -e ${GRADLE} ; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ${GRADLE}" >&5
printf "%s\n" "${GRADLE}" >&6; }
if 1; then
HAVE_GRADLE_TRUE=
HAVE_GRADLE_FALSE='#'
else
HAVE_GRADLE_TRUE='#'
HAVE_GRADLE_FALSE=
fi
else
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
printf "%s\n" "no" >&6; }
if 0; then
HAVE_GRADLE_TRUE=
HAVE_GRADLE_FALSE='#'
else
HAVE_GRADLE_TRUE='#'
HAVE_GRADLE_FALSE=
fi
fi
FreeBSD requires __BSD_VISIBLE to be set to expose M_PI and mkstemp() in the
system includes. This is normally set when _ANSI_SOURCE, _C99_SOURCE, or
_C11_SOURCE are undefined. I don't want to dig into what the compiler is
setting, so I'm just setting it in the configure script.
/bin/sh ./libtool --tag=CC --mode=compile cc -DHAVE_CONFIG_H -I. -fPIC -fvisibility=hidden -pedantic -fno-exceptions -D PATH_ESPEAK_DATA=\"/usr/local/share/espeak-ng-data\" -DLIBESPEAK_NG_EXPORT -Isrc/include -Isrc/include/compat -I src/ucd-tools/src/include -D_BSD_SOURCE -D_DEFAULT_SOURCE -D_POSIX_C_SOURCE=200112L -Wno-endif-labels -g -O2 -std=c99 -MT src/libespeak-ng/src_libespeak_ng_la-wavegen.lo -MD -MP -MF src/libespeak-ng/.deps/src_libespeak_ng_la-wavegen.Tpo -c -o src/libespeak-ng/src_libespeak_ng_la-wavegen.lo `test -f 'src/libespeak-ng/wavegen.c' || echo './'`src/libespeak-ng/wavegen.c
libtool: compile: cc -DHAVE_CONFIG_H -I. -fPIC -fvisibility=hidden -pedantic -fno-exceptions -D PATH_ESPEAK_DATA=\"/usr/local/share/espeak-ng-data\" -DLIBESPEAK_NG_EXPORT -Isrc/include -Isrc/include/compat -I src/ucd-tools/src/include -D_BSD_SOURCE -D_DEFAULT_SOURCE -D_POSIX_C_SOURCE=200112L -Wno-endif-labels -g -O2 -std=c99 -MT src/libespeak-ng/src_libespeak_ng_la-wavegen.lo -MD -MP -MF src/libespeak-ng/.deps/src_libespeak_ng_la-wavegen.Tpo -c src/libespeak-ng/wavegen.c -fPIC -DPIC -o src/libespeak-ng/.libs/src_libespeak_ng_la-wavegen.o
src/libespeak-ng/wavegen.c:355:24: error: use of undeclared identifier 'M_PI'
x = 127*(1.0 - cos((M_PI*2)*ix/wavemult_max));
^
src/libespeak-ng/wavegen.c:623:16: error: use of undeclared identifier 'M_PI'
minus_pi_t = -M_PI / samplerate;
^
2 errors generated.
gmake[1]: *** [Makefile:1690: src/libespeak-ng/src_libespeak_ng_la-wavegen.lo] Error 1
Fix running 'make clean' when gradle is not present. Gradle is used for the Android build and is not needed when just building eSpeak NG on Linux/BSD systems.