Update configure for building in strict C99 mode

Related to:

  <https://fedoraproject.org/wiki/Changes/PortingToModernC>
  <https://fedoraproject.org/wiki/Toolchain/PortingToModernC>
This commit is contained in:
Florian Weimer 2022-11-18 09:55:46 +01:00
parent aca22ab790
commit f8704b6b1c
2 changed files with 30 additions and 0 deletions

28
tcl-configure-c99.patch Normal file
View File

@ -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 <time.h>]],
[[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 <time.h>]],
[[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?])

View File

@ -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