diff --git a/motif-c99-bug1602.patch b/motif-c99-bug1602.patch new file mode 100644 index 0000000..b20340b --- /dev/null +++ b/motif-c99-bug1602.patch @@ -0,0 +1,54 @@ +commit 56dae22f7c2e7446852af1d68116f1809edae633 +Author: Mykola Vshyvkov +Date: Wed Jun 26 19:21:20 2013 +0300 + + Fixed bug #1602 (Eliminates 6 warnings "implicit declaration of function" in some modules). + +diff --git a/tools/wml/wml.c b/tools/wml/wml.c +index d8ad382ebb93f0cc..723288a9c29cead2 100644 +--- a/tools/wml/wml.c ++++ b/tools/wml/wml.c +@@ -80,6 +80,7 @@ static char rcsid[] = "$TOG: wml.c /main/8 1999/04/16 09:41:47 mgreess $" + #endif + #include + #include ++#include + + + /* +@@ -159,6 +160,7 @@ void wmlInit (); + * External variables + */ + extern int yyleng; ++extern int yyparse(); + + + +diff --git a/tools/wml/wmloutp1.c b/tools/wml/wmloutp1.c +index c826c4f0fad65b68..ea6a8e2780d08d78 100644 +--- a/tools/wml/wmloutp1.c ++++ b/tools/wml/wmloutp1.c +@@ -45,6 +45,11 @@ static char rcsid[] = "$XConsortium: wmloutp1.c /main/7 1995/07/13 21:04:31 drk + + #include "wml.h" + ++/* External functions declaraion */ ++extern void wmlOutputKeyWordFiles (); ++extern void wmlOutputMmFiles(); ++ ++ + + void wmlOutput () + +diff --git a/tools/wml/wmlresolve.c b/tools/wml/wmlresolve.c +index 3b8642c12474cfbd..c9bc84151f8a7902 100644 +--- a/tools/wml/wmlresolve.c ++++ b/tools/wml/wmlresolve.c +@@ -58,6 +58,7 @@ static char rcsid[] = "$XConsortium: wmlresolve.c /main/9 1995/08/29 11:11:05 dr + #include + #endif + #include ++#include + + /* + * Routines used only in this module diff --git a/motif-c99-bug1605.patch b/motif-c99-bug1605.patch new file mode 100644 index 0000000..ac47267 --- /dev/null +++ b/motif-c99-bug1605.patch @@ -0,0 +1,134 @@ +commit d094e8c4a6a1890520ade3e1900229454dc2eac2 +Author: Mykola Vshyvkov +Date: Mon Jul 1 19:02:25 2013 +0300 + + Fixed bug #1605 (Eliminates 14 warnings of some types in WML tool). + +diff --git a/lib/Xm/XmRenderT.c b/lib/Xm/XmRenderT.c +index 0abd71265fc901b9..5ecd38bef29d2c6b 100644 +--- a/lib/Xm/XmRenderT.c ++++ b/lib/Xm/XmRenderT.c +@@ -1993,7 +1993,7 @@ GetSameRenditions(XmRendition *rend_cache, XmRendition rend, int count_rend) + for (i=0; i +Date: Wed Jul 3 18:52:21 2013 +0300 + + Fixed bug #1609 (Eliminates 18 warnings of "incompatible implicit declaration" in modules of "clients" catalog). + +diff --git a/clients/mwm/WmCmd.c b/clients/mwm/WmCmd.c +index f21d41d541dc50a3..4d723aa4848314f6 100644 +--- a/clients/mwm/WmCmd.c ++++ b/clients/mwm/WmCmd.c +@@ -48,6 +48,7 @@ + #include "WmWsm.h" + #include "WmDebug.h" + #include "WmWinConf.h" ++#include "WmFeedback.h" + + + +diff --git a/clients/mwm/WmCmd.h b/clients/mwm/WmCmd.h +index ff779defe240933b..e8bc104e850c5ec3 100644 +--- a/clients/mwm/WmCmd.h ++++ b/clients/mwm/WmCmd.h +@@ -59,5 +59,8 @@ extern void AddWindowMenuEntry (ClientData *); + extern void DeleteCommand (long, CmdTree **); + extern void SendInvokeMessage (CARD32, CARD32, Atom, Time); + ++extern void ++GetAutomationData (XtPointer input, Atom *outputType, XtPointer *output, unsigned long *outputLen, int *outputFmt); ++ + + #endif /* _WM_CMD_ */ +diff --git a/clients/mwm/WmFunction.c b/clients/mwm/WmFunction.c +index 9a2102bcf80cbf08..94fb8cde2c0ec83d 100644 +--- a/clients/mwm/WmFunction.c ++++ b/clients/mwm/WmFunction.c +@@ -112,6 +112,7 @@ extern pid_t vfork(); + #include "WmWinList.h" + #include "WmWinState.h" + #include "WmXSMP.h" ++#include "WmCmd.h" + + #include /* for MS_LastManagedMenuTime */ + extern XmMenuState _XmGetMenuState(); +diff --git a/clients/mwm/WmInitWs.c b/clients/mwm/WmInitWs.c +index aaa584cd3e4ce7b7..d29b5f96fec246fc 100644 +--- a/clients/mwm/WmInitWs.c ++++ b/clients/mwm/WmInitWs.c +@@ -134,6 +134,7 @@ typedef struct + #include + #endif /* WSM */ + #include "WmXSMP.h" ++#include "Xm/VirtKeysI.h" + + /* + * Function Declarations: +diff --git a/clients/mwm/WmResParse.c b/clients/mwm/WmResParse.c +index 465f5b4d29e99411..a63e928acd643c54 100644 +--- a/clients/mwm/WmResParse.c ++++ b/clients/mwm/WmResParse.c +@@ -63,6 +63,7 @@ static char rcsid[] = "$XConsortium: WmResParse.c /main/9 1996/11/01 10:17:34 dr + #include "WmResource.h" + + #include ++#include "Xm/VirtKeysI.h" + + #include + #include +diff --git a/clients/mwm/WmWinList.c b/clients/mwm/WmWinList.c +index a45a4fc9471ab21d..31472a5caa832d90 100644 +--- a/clients/mwm/WmWinList.c ++++ b/clients/mwm/WmWinList.c +@@ -63,7 +63,7 @@ static char rcsid[] = "$TOG: WmWinList.c /main/8 1997/06/10 15:50:50 samborn $" + #ifdef WSM + #include "WmWrkspace.h" + #endif /* WSM */ +- ++#include "WmEvent.h" + + + +diff --git a/clients/mwm/WmWsmLib/recv.c b/clients/mwm/WmWsmLib/recv.c +index 8b2833fbc2ea756f..06908e24756b0e3c 100644 +--- a/clients/mwm/WmWsmLib/recv.c ++++ b/clients/mwm/WmWsmLib/recv.c +@@ -38,6 +38,8 @@ XtPointer *, unsigned long *, int * + ); + #endif /* JUNK */ + ++extern Time GetTimestamp (Display *dpy); ++ + + /* Function Name: WSMDefaultOwnSelection + * Description: This is the default routine that owns the proper +diff --git a/clients/mwm/WmWsmLib/send.c b/clients/mwm/WmWsmLib/send.c +index 8792e2c7c8ac82bb..c261da70bfff366a 100644 +--- a/clients/mwm/WmWsmLib/send.c ++++ b/clients/mwm/WmWsmLib/send.c +@@ -45,6 +45,8 @@ static void ReplyReceived( + Widget, XtPointer, Atom *, Atom *, XtPointer, unsigned long *, int * + ); + ++extern Time GetTimestamp (Display *dpy); ++ + /* Function Name: WSMSendMessage + * Description: Sends a message to WSM or WM on the screen + * and display specified. +diff --git a/clients/uil/UilDefI.h b/clients/uil/UilDefI.h +index a0176b619e89f1eb..f17bff764bf6fd1e 100644 +--- a/clients/uil/UilDefI.h ++++ b/clients/uil/UilDefI.h +@@ -608,7 +608,7 @@ extern void sym_dump_object_variant _ARGUMENTS(( sym_def_obj_entry_type *az_sym + extern void sym_dump_root_entry _ARGUMENTS(( sym_root_entry_type *az_symbol_entry )); + extern char *sym_section_text _ARGUMENTS(( int b_type )); + extern void dump_free_list _ARGUMENTS(( void )); +- ++extern int sar_get_units_type (yystype *parse_frame); + #if defined(__cplusplus) || defined(c_plusplus) + } + #endif +diff --git a/clients/uil/UilMain.c b/clients/uil/UilMain.c +index 6120eda2fa176670..1864ba78597e2dd6 100644 +--- a/clients/uil/UilMain.c ++++ b/clients/uil/UilMain.c +@@ -104,9 +104,10 @@ static void UilWrapup _ARGUMENTS((Uil_compile_desc_type *compile_desc)); + #endif + + externaldef(uilmsg) nl_catd uil_catd = NULL; +- + #endif + ++extern int yyparse(); ++ + /* + ** + ** MODULE Definitions +diff --git a/clients/xmbind/xmbind.c b/clients/xmbind/xmbind.c +index f3d5a67ce35dab84..a16e2d968c45f7f0 100644 +--- a/clients/xmbind/xmbind.c ++++ b/clients/xmbind/xmbind.c +@@ -29,6 +29,7 @@ static char rcsid[] = "$TOG: xmbind.c /main/10 1997/06/18 17:34:48 samborn $" + #endif + #endif + #include ++#include + #include + + /* Internal routines "borrowed" from libXm. Don't try this at home! */ diff --git a/motif-c99-string.patch b/motif-c99-string.patch new file mode 100644 index 0000000..ff07b71 --- /dev/null +++ b/motif-c99-string.patch @@ -0,0 +1,19 @@ +Unconditionally include , to avoid implicit function +declarations. libXpm defines SYSV during the build, which is why they +do not see t his isssue. + +diff --git a/lib/Xm/XpmI.h b/lib/Xm/XpmI.h +index bbba02b0cac1f91e..3468f2d1edf84f7c 100644 +--- a/lib/Xm/XpmI.h ++++ b/lib/Xm/XpmI.h +@@ -118,9 +118,9 @@ extern "C" { + extern FILE *popen(); + #endif + +-#if defined(SYSV) || defined(SVR4) || defined(VMS) || defined(WIN32) || defined (_SVID_SOURCE) + #include + ++#if defined(SYSV) || defined(SVR4) || defined(VMS) || defined(WIN32) || defined (_SVID_SOURCE) + #ifndef index + #define index strchr + #endif diff --git a/motif-c99-void-sprintf.patch b/motif-c99-void-sprintf.patch new file mode 100644 index 0000000..040c79e --- /dev/null +++ b/motif-c99-void-sprintf.patch @@ -0,0 +1,40 @@ +Stop defining VOID_SPRINTF, following what upstream libXpm does. The +check has an implicit declaration of exit and an implicit int, so it +will fail to build with future compilers. + +diff --git a/acinclude.m4 b/acinclude.m4 +index 88edfce3d169a267..38409a28a65cb028 100644 +--- a/acinclude.m4 ++++ b/acinclude.m4 +@@ -45,19 +45,6 @@ if test $lt_cv_xthreads = yes; then + fi + ]) + +-dnl This test is not very reliable probably ... +-AC_DEFUN([AM_FUNC_VOID_SPRINTF], +-[AC_CACHE_CHECK(whether sprintf returns void, ac_cv_func_void_sprintf, +-[AC_TRY_RUN([#include +-int sprintf(); main() { exit(sprintf(".")); }], +- ac_cv_func_void_sprintf=no, ac_cv_func_void_sprintf=yes, ac_cv_func_void_sprintf=yes)]) +-if test $ac_cv_func_void_sprintf = no; then +- AC_DEFINE(VOID_SPRINTF,1, +- [Define if sprintf doesn't return the number of chars written]) +-fi +-]) +- +- + dnl + dnl End of special macros. + dnl +diff --git a/configure.ac b/configure.ac +index 3b412361e6f43da4..6cbeb2f5eea235eb 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -120,7 +120,6 @@ AC_FUNC_STRCOLL + AC_FUNC_STRFTIME + AC_FUNC_FORK([]) + AC_FUNC_VPRINTF +-AM_FUNC_VOID_SPRINTF + AC_CHECK_FUNCS(wcslen wcscpy wcsncpy wcschr wcscat wcsncat getcwd gettimeofday mkdir re_comp regcmp select strcspn strerror strstr strtod strtol uname) + AC_CHECK_FUNCS(strdup,,AC_DEFINE(NEED_STRDUP, 1, no strdup)) + AC_CHECK_FUNCS(strcasecmp,,AC_DEFINE(NEED_STRCASECMP, 1, no strcasecmp)) diff --git a/motif-configure-c99.patch b/motif-configure-c99.patch new file mode 100644 index 0000000..63a081a --- /dev/null +++ b/motif-configure-c99.patch @@ -0,0 +1,20 @@ +Another implicit declaration of exit in the -DXTHREADS check, which +will go wrong with future compilers that do not support implicit +function declarations. + +diff --git a/acinclude.m4 b/acinclude.m4 +index 61706f3e63d94d8a..88edfce3d169a267 100644 +--- a/acinclude.m4 ++++ b/acinclude.m4 +@@ -22,9 +22,9 @@ int main() { + Boolean brc; + brc=XtToolkitThreadInitialize(); + if (True==brc) +- exit(0); ++ return 0; + else +- exit(1); ++ return 1; + } + ], + lt_cv_xthreads=yes, diff --git a/motif.spec b/motif.spec index 7908ae3..6fcec9c 100644 --- a/motif.spec +++ b/motif.spec @@ -1,7 +1,7 @@ Summary: Run-time libraries and programs Name: motif Version: 2.3.4 -Release: 27%{?dist} +Release: 28%{?dist} License: LGPLv2+ Source: http://downloads.sf.net/motif/motif-%{version}-src.tgz Source1: xmbind @@ -31,6 +31,12 @@ Patch46: motif-2.3.4-bindings.patch Patch47: openMotif-2.3.0-no_X11R6.patch # FTBFS #1448819 Patch48: motif-2.3.4-Fix-issues-with-Werror-format-security.patch +Patch49: motif-configure-c99.patch +Patch50: motif-c99-void-sprintf.patch +Patch51: motif-c99-string.patch +Patch52: motif-c99-bug1602.patch +Patch53: motif-c99-bug1605.patch +Patch54: motif-c99-bug1609.patch Conflicts: lesstif <= 0.92.32-6 @@ -70,6 +76,12 @@ This package contains the static Motif libraries. %patch46 -p1 -b .bindings %patch47 -p1 -b .no_X11R6 %patch48 -p1 -b .format-security +%patch49 -p1 +%patch50 -p1 +%patch51 -p1 +%patch52 -p1 +%patch53 -p1 +%patch54 -p1 %build ./autogen.sh @@ -119,6 +131,9 @@ rm -f %{buildroot}%{_libdir}/*.la %{_libdir}/lib*.a %changelog +* Fri Apr 14 2023 Florian Weimer - 2.3.4-28 +- Port to C99 (#2186773) + * Thu Jan 19 2023 Fedora Release Engineering - 2.3.4-27 - Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild