From f8704b6b1cc1d604f6d7a8df9222cda1f7c59cfc Mon Sep 17 00:00:00 2001 From: Florian Weimer Date: Fri, 18 Nov 2022 09:55:46 +0100 Subject: [PATCH] Update configure for building in strict C99 mode Related to: --- tcl-configure-c99.patch | 28 ++++++++++++++++++++++++++++ tcl.spec | 2 ++ 2 files changed, 30 insertions(+) create mode 100644 tcl-configure-c99.patch diff --git a/tcl-configure-c99.patch b/tcl-configure-c99.patch new file mode 100644 index 0000000..bcb9f19 --- /dev/null +++ b/tcl-configure-c99.patch @@ -0,0 +1,28 @@ +Avoid calling the exit function without declaring it first. + +Submitted upstream here: + +https://core.tcl-lang.org/tcl/tktview/d550f4837a078ff3054d3b00a156d8a11fb628cf + +diff --git a/unix/tcl.m4 b/unix/tcl.m4 +index ed12cda75bbc4ad9..d77184421bf8df16 100644 +--- a/unix/tcl.m4 ++++ b/unix/tcl.m4 +@@ -2352,7 +2352,7 @@ AC_DEFUN([SC_TIME_HANDLER], [ + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], + [[extern long timezone; + timezone += 1; +- exit (0);]])], ++ return 0;]])], + [tcl_cv_timezone_long=yes], [tcl_cv_timezone_long=no])]) + if test $tcl_cv_timezone_long = yes ; then + AC_DEFINE(HAVE_TIMEZONE_VAR, 1, [Should we use the global timezone variable?]) +@@ -2364,7 +2364,7 @@ AC_DEFUN([SC_TIME_HANDLER], [ + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], + [[extern time_t timezone; + timezone += 1; +- exit (0);]])], ++ return 0;]])], + [tcl_cv_timezone_time=yes], [tcl_cv_timezone_time=no])]) + if test $tcl_cv_timezone_time = yes ; then + AC_DEFINE(HAVE_TIMEZONE_VAR, 1, [Should we use the global timezone variable?]) diff --git a/tcl.spec b/tcl.spec index 14e0a3a..224c7e3 100644 --- a/tcl.spec +++ b/tcl.spec @@ -21,6 +21,7 @@ Patch0: tcl-8.6.12-autopath.patch Patch1: tcl-8.6.12-conf.patch Patch2: tcl-8.6.12-hidden.patch Patch3: tcl-8.6.10-tcltests-path-fix.patch +Patch4: tcl-configure-c99.patch %if %sdt BuildRequires: systemtap-sdt-devel @@ -67,6 +68,7 @@ chmod -x generic/tclStrToD.c %patch1 -p1 -b .conf %patch2 -p1 -b .hidden %patch3 -p1 -b .tcltests-path-fix +%patch4 -p1 -b .configure-c99 %build pushd unix