diff options
author | Bruno Haible <bruno@clisp.org> | 2021-05-13 11:25:41 +0200 |
---|---|---|
committer | Eric Blake <eblake@redhat.com> | 2021-05-26 08:56:18 -0500 |
commit | f66e55f3a2512fa0d19521e7882c6a113a63a21a (patch) | |
tree | 088513adcac525e6fb9739528955a1b43fb3ef95 | |
parent | b8668a73ba99428bcea530fdaae0be6dcb0b7dbd (diff) | |
download | m4-f66e55f3a2512fa0d19521e7882c6a113a63a21a.tar.gz |
Enable more single-thread optimizations in gnulib code
On many systems (esp. BSD ones), building a recent m4 snapshot produces these
warnings:
--------------------------------------------------------------------------------
CC regex.o
In file included from ../../lib/regex_internal.h:57:0,
from ../../lib/regex.c:70:
../../lib/regcomp.c: In function 'rpl_regfree':
../../lib/glthread/lock.h:640:38: warning: statement with no effect [-Wunused-value]
# define glthread_lock_destroy(NAME) 0
^
../../lib/regex_internal.h:60:26: note: in expansion of macro 'glthread_lock_destroy'
# define lock_fini(lock) glthread_lock_destroy (&(lock))
^
...
--------------------------------------------------------------------------------
According to the Gnulib documentation section "Optimizations of multithreaded
code" several more optimizations can be enabled. This patch
- enables these single-threading optimizations,
- by doing so, gets rid of the warnings in regex.c,
- causes no test failures.
* configure.ac (GNULIB_REGEX_SINGLE_THREAD, GNULIB_MBRTOWC_SINGLE_THREAD,
GNULIB_WCHAR_SINGLE_LOCALE): Define as C macros.
Message-Id: <3311608.oHEOCP8NKg@omega>
-rw-r--r-- | configure.ac | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac index 04a7d4be..517666f1 100644 --- a/configure.ac +++ b/configure.ac @@ -42,6 +42,9 @@ gl_ASSERT_NO_GNULIB_POSIXCHECK # M4 is single-threaded; so we can optimize gnulib code by using this: gl_DISABLE_THREADS +AC_DEFINE([GNULIB_REGEX_SINGLE_THREAD], [1], [Define to optimize regex.]) +AC_DEFINE([GNULIB_MBRTOWC_SINGLE_THREAD], [1], [Define to optimize mbrtowc.]) +AC_DEFINE([GNULIB_WCHAR_SINGLE_LOCALE], [1], [Define to optimize mbrtowc.]) AC_ARG_ENABLE([gcc-warnings], [AS_HELP_STRING([--enable-gcc-warnings], |