Florian Weimer 2023-04-14 14:22:57 +02:00
parent 6a65188e7e
commit 5e2c9f6f8b
7 changed files with 430 additions and 1 deletions

54
motif-c99-bug1602.patch Normal file
View File

@ -0,0 +1,54 @@
commit 56dae22f7c2e7446852af1d68116f1809edae633
Author: Mykola Vshyvkov <mvshyvk@softserveinc.com>
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 <stdio.h>
#include <stdlib.h>
+#include <unistd.h>
/*
@@ -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 <stdlib.h>
#endif
#include <stdio.h>
+#include <string.h>
/*
* Routines used only in this module

134
motif-c99-bug1605.patch Normal file
View File

@ -0,0 +1,134 @@
commit d094e8c4a6a1890520ade3e1900229454dc2eac2
Author: Mykola Vshyvkov <mvshyvk@softserveinc.com>
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<count_rend; i++){
if ( rend_cache && (rend_cache[i])
- && (((_XmRendFontName(rend) && _XmRendFontName(rend_cache[i]) ) && !strcmp(_XmRendFontName(rend_cache[i]), _XmRendFontName(rend))
+ && ((((_XmRendFontName(rend) && _XmRendFontName(rend_cache[i]) ) && !strcmp(_XmRendFontName(rend_cache[i]), _XmRendFontName(rend)))
|| (!_XmRendFontName(rend) && !_XmRendFontName(rend_cache[i])))
&& (((_XmRendFontFoundry(rend) && _XmRendFontFoundry(rend_cache[i])) && !strcmp(_XmRendFontFoundry(rend_cache[i]), _XmRendFontFoundry(rend)))
|| (!_XmRendFontFoundry(rend) && !_XmRendFontFoundry(rend_cache[i])))
diff --git a/tools/wml/wml.h b/tools/wml/wml.h
index 91d3857d005b90ce..d4bd405d6f910cc8 100644
--- a/tools/wml/wml.h
+++ b/tools/wml/wml.h
@@ -678,6 +678,19 @@ extern void wmlCreateCharset ();
extern void wmlAddCharsetAttribute ();
extern void LexIssueError ();
+/* May be, declaration of functions must be next:
+extern void wmlAddClassChild ();
+extern void wmlCreateChild ();
+extern void wmlCreateOrAppendCtrlList ();
+extern void wmlAddCtrlListControl ();
+ But, we are using real function arguments type declaration:
+*/
+extern void wmlAddClassChild (char *);
+extern void wmlCreateChild (char *, char *);
+extern void wmlCreateOrAppendCtrlList (char *);
+extern void wmlAddCtrlListControl (char *);
+
+
/*
* Defined in wmlresolve.c
diff --git a/tools/wml/wmldbcreate.c b/tools/wml/wmldbcreate.c
index 6de585ae8d12c17d..b6b12dca6aad399d 100644
--- a/tools/wml/wmldbcreate.c
+++ b/tools/wml/wmldbcreate.c
@@ -260,7 +260,7 @@ void emit_chars(table_id)
int table_id;
{
_db_header header;
- unsigned char *ptr;
+ unsigned char *ptr = NULL;
int i;
switch (table_id)
@@ -338,7 +338,7 @@ void emit_ints_and_string(table_id)
int table_id;
{
_db_header header;
- key_keytable_entry_type *table;
+ key_keytable_entry_type *table = NULL;
int i;
switch (table_id)
@@ -376,7 +376,7 @@ void emit_ints_and_string(table_id)
void emit_char_table(table_id)
int table_id;
{
- unsigned char **table;
+ unsigned char **table = NULL;
_db_header header;
unsigned char *entry_vec;
int i, j;
@@ -437,7 +437,7 @@ int table_id;
_db_header header;
int *lengths;
char *string_table;
- char **table;
+ char **table = NULL;
int i;
switch (table_id)
@@ -558,7 +558,7 @@ void emit_shorts(table_id)
int table_id;
{
_db_header header;
- unsigned short int *ptr;
+ unsigned short int *ptr = NULL;
int i;
switch (table_id)
@@ -624,7 +624,7 @@ void emit_int_and_table_shorts(table_id)
int table_id;
{
_db_header header;
- UilEnumSetDescDef *table;
+ UilEnumSetDescDef *table = NULL;
int j, i;
unsigned short int *value_vec;
@@ -657,7 +657,7 @@ void emit_ints(table_id)
int table_id;
{
_db_header header;
- int *ptr;
+ int *ptr = NULL;
int i;
switch (table_id)
diff --git a/tools/wml/wmllex.l b/tools/wml/wmllex.l
index ea21dfe64176e75f..5e3158d3a54e448c 100644
--- a/tools/wml/wmllex.l
+++ b/tools/wml/wmllex.l
@@ -95,7 +95,6 @@ int yytknval2; /* terminal token value 2 */
"Gadget" { return GADGET;}
"Argument" { return ARGUMENT;}
"Reason" { return REASON;}
-"Constraint" { return CONSTRAINT;}
"SubResource" { return SUBRESOURCE;}
"True" { return ATTRTRUE; }
"False" { return ATTRFALSE; }
diff --git a/tools/wml/wmluiltok.l b/tools/wml/wmluiltok.l
index d334e4f46302cde9..f02d9fec34d821ce 100644
--- a/tools/wml/wmluiltok.l
+++ b/tools/wml/wmluiltok.l
@@ -82,6 +82,7 @@ TokenRec token[1000];
TokenRec temp;
void add_token ();
+int yywrap ();
int phase = 0;
int keyword_count;

147
motif-c99-bug1609.patch Normal file
View File

@ -0,0 +1,147 @@
commit 7a52b1ea7e1ec88ba854db30a51d9f68f2f0078f
Author: Mykola Vshyvkov <mvshyvk@softserveinc.com>
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 <Xm/RowColumnP.h> /* 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 <stdlib.h>
#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 <Xm/VirtKeysP.h>
+#include "Xm/VirtKeysI.h"
#include <X11/cursorfont.h>
#include <X11/keysym.h>
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 <stdio.h>
+#include <stdlib.h>
#include <Xm/Xm.h>
/* Internal routines "borrowed" from libXm. Don't try this at home! */

19
motif-c99-string.patch Normal file
View File

@ -0,0 +1,19 @@
Unconditionally include <string.h>, 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 <string.h>
+#if defined(SYSV) || defined(SVR4) || defined(VMS) || defined(WIN32) || defined (_SVID_SOURCE)
#ifndef index
#define index strchr
#endif

View File

@ -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 <stdio.h>
-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))

20
motif-configure-c99.patch Normal file
View File

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

View File

@ -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 <fweimer@redhat.com> - 2.3.4-28
- Port to C99 (#2186773)
* Thu Jan 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 2.3.4-27
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild