workaround for gcc 3.3. bug - alternate strftime test

This commit is contained in:
rathnor 2003-06-15 12:28:37 +00:00
parent fbcd0c3191
commit b681e308a2
2 changed files with 27 additions and 1 deletions

View file

@ -1,6 +1,9 @@
(Format: Year/Month/Day) (Format: Year/Month/Day)
Changes for 0.9.4: Changes for 0.9.4:
*03/06/15: *03/06/15:
* Apply workaround for strftime test - fails with gcc 3.3 due to
compiler bug? - thanks Joshua Kwan (Simon)
configure.in
* Fix group cycling, also adding new "NextGroup/PrevGroup" keys (Simon) * Fix group cycling, also adding new "NextGroup/PrevGroup" keys (Simon)
Screen.hh/cc Keys.hh/cc fluxbox.cc Screen.hh/cc Keys.hh/cc fluxbox.cc
*03/06/13: *03/06/13:

View file

@ -31,7 +31,30 @@ AC_HEADER_TIME
dnl Check for existance of basename(), setlocale() and strftime() dnl Check for existance of basename(), setlocale() and strftime()
AC_CHECK_FUNCS(basename, , AC_CHECK_LIB(gen, basename, LIBS="$LIBS -lgen")) AC_CHECK_FUNCS(basename, , AC_CHECK_LIB(gen, basename, LIBS="$LIBS -lgen"))
AC_CHECK_FUNCS(getpid setlocale sigaction strftime strcasestr snprintf vsnprintf catopen catgets catclose) AC_CHECK_FUNCS(getpid setlocale sigaction strcasestr snprintf vsnprintf catopen catgets catclose)
dnl The autoconf test for strftime is broken now (due to gcc 3.3 bug?):
dnl Gcc 3.3 testprog = ``extern "C" char strftime;'', build with g++ test.cc
dnl breaks with:
dnl test.cc:1: error: nonnull argument with out-of-range operand number
dnl (arg 1, operand 3)
AC_MSG_CHECKING(for strftime)
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([#include <time.h>],
[[
char * s;
time_t t = time(NULL);
size_t x = strftime(s, 5, "%a", localtime(&t));
]]
)],
[
AC_DEFINE(HAVE_STRFTIME, 1, [Define to 1 if you have the 'strftime' function.])
AC_MSG_RESULT(yes)
],
[AC_MSG_RESULT(no)])
AC_CHECK_LIB(nsl, t_open, LIBS="$LIBS -lnsl") AC_CHECK_LIB(nsl, t_open, LIBS="$LIBS -lnsl")
AC_CHECK_LIB(socket, socket, LIBS="$LIBS -lsocket") AC_CHECK_LIB(socket, socket, LIBS="$LIBS -lsocket")