diff -Nurd -x'*~' motif-2.3.4.orig/Makefile.am motif-2.3.4/Makefile.am
--- motif-2.3.4.orig/Makefile.am	2012-10-22 10:50:38.000000000 -0400
+++ motif-2.3.4/Makefile.am	2015-11-18 00:10:47.000000000 -0500
@@ -28,7 +28,6 @@
              include \
              tools \
              clients \
-             doc \
-             demos
+             doc
 AUTOMAKE_OPTIONS = 1.4
 ACLOCAL_AMFLAGS = -I .
diff -Nurd -x'*~' motif-2.3.4.orig/ac_find_xft.m4 motif-2.3.4/ac_find_xft.m4
--- motif-2.3.4.orig/ac_find_xft.m4	2012-10-22 10:50:38.000000000 -0400
+++ motif-2.3.4/ac_find_xft.m4	2015-11-18 00:10:47.000000000 -0500
@@ -75,7 +75,8 @@
 LIBS="$LIBS $freetype_lib"
 saved_CPPFLAGS="$CPPFLAGS"
 CPPFLAGS="$CPPFLAGS $FREETYPE_CFLAGS"
-AC_CHECK_HEADERS(freetype/freetype.h)
+AC_CHECK_HEADERS(ft2build.h)	# modern ft detection...
+ac_cv_header_freetype_freetype_h=yes # propagated via legacy variables
 
 FINDXFT_HAVE_FREETYPE="no"
 case "$ac_cv_header_freetype_freetype_h" in
diff -Nurd -x'*~' motif-2.3.4.orig/autogen.sh motif-2.3.4/autogen.sh
--- motif-2.3.4.orig/autogen.sh	2012-10-22 10:50:34.000000000 -0400
+++ motif-2.3.4/autogen.sh	2015-11-18 00:10:47.000000000 -0500
@@ -1,7 +1,6 @@
 #!/bin/sh
 
-srcdir=`dirname $0`
-test -z "$srcdir" && srcdir=.
+srcdir=.
 
 THEDIR="`pwd`"
 cd "$srcdir"
diff -Nurd -x'*~' motif-2.3.4.orig/clients/mwm/WmCEvent.c motif-2.3.4/clients/mwm/WmCEvent.c
--- motif-2.3.4.orig/clients/mwm/WmCEvent.c	2012-10-22 10:50:39.000000000 -0400
+++ motif-2.3.4/clients/mwm/WmCEvent.c	2015-11-18 00:10:47.000000000 -0500
@@ -2570,7 +2570,7 @@
 
 void HandleClientMessage (ClientData *pCD, XClientMessageEvent *clientEvent)
 {
-    unsigned int newState;
+    unsigned int newState = 0;
 
     /*
      * Process the client message event based on the message_type.
diff -Nurd -x'*~' motif-2.3.4.orig/clients/mwm/WmCmd.c motif-2.3.4/clients/mwm/WmCmd.c
--- motif-2.3.4.orig/clients/mwm/WmCmd.c	2012-10-22 10:50:39.000000000 -0400
+++ motif-2.3.4/clients/mwm/WmCmd.c	2015-11-18 00:10:47.000000000 -0500
@@ -1032,7 +1032,7 @@
       MenuSpec *pMS;
       WmScreenData *pSD = ACTIVE_PSD;
 
-      while (tPtr = FindCmd (cmdKillList[ i ], CCI_TREE_OF_SCR(scr)))
+      while ((tPtr = FindCmd (cmdKillList[ i ], CCI_TREE_OF_SCR(scr))))
 	{
 	  /* make sure ModifyClientCommandTree can't muck with cmdTree. */
 	  pNext = tPtr->next;
@@ -2092,7 +2092,7 @@
   XtPointer reply;
   int size;
 
-  int i, n, menuItemCount;
+  int i, n, menuItemCount = 0;
   MenuItem *menu_item;
 
 
diff -Nurd -x'*~' motif-2.3.4.orig/clients/mwm/WmMenu.c motif-2.3.4/clients/mwm/WmMenu.c
--- motif-2.3.4.orig/clients/mwm/WmMenu.c	2012-10-22 10:50:39.000000000 -0400
+++ motif-2.3.4/clients/mwm/WmMenu.c	2015-11-18 00:10:47.000000000 -0500
@@ -848,8 +848,8 @@
 static MenuItem *MakeClientCommandMenuItem (String label, String funcArgs)
 {
     return(MakeMenuItem(label, F_InvokeCommand, funcArgs,
-			(KeySym) NULL, (unsigned int)0,
-			(KeyCode) NULL, (String)NULL));
+			(KeySym)(uintptr_t) NULL, (unsigned int)0,
+			(KeyCode)(uintptr_t) NULL, (String)(uintptr_t)NULL));
 }
 
 
@@ -2203,7 +2203,7 @@
 	    if (newMenuSpec == (MenuSpec *) NULL)
 	    {
 		newMenuSpec = MakeMenuSpec(funcarg_buf,
-					   tree == NULL ? (CARD32)NULL
+					   tree == NULL ? (CARD32)(uintptr_t)NULL
 					                : tree->commandID);
 		if (duplicate_globals) newMenuSpec->clientLocal = TRUE;
 		else 		       newMenuSpec->clientLocal = FALSE;
diff -Nurd -x'*~' motif-2.3.4.orig/clients/mwm/WmResParse.c motif-2.3.4/clients/mwm/WmResParse.c
--- motif-2.3.4.orig/clients/mwm/WmResParse.c	2012-10-22 10:50:39.000000000 -0400
+++ motif-2.3.4/clients/mwm/WmResParse.c	2015-11-18 00:10:47.000000000 -0500
@@ -177,7 +177,7 @@
     {"mod3",	Mod3Mask},
     {"mod4",	Mod4Mask},
     {"mod5",	Mod5Mask},
-    {NULL,      (unsigned int)NULL},
+    {NULL,      (unsigned int)(uintptr_t)NULL},
 };
 
 #define ALT_INDEX 3
@@ -340,14 +340,14 @@
     {"btn5up",      ButtonRelease,  ParseImmed,    Button5,  FALSE},
     {"btn5click",   ButtonRelease,  ParseImmed,    Button5,  TRUE},
     {"btn5click2",  ButtonPress,    ParseImmed,    Button5,  TRUE},
-    { NULL, (unsigned int)NULL, (Boolean(*)())NULL, (unsigned int)NULL, (Boolean)NULL}
+    { NULL, (unsigned int)(uintptr_t)NULL, (Boolean(*)())NULL, (unsigned int)(uintptr_t)NULL, (Boolean)(uintptr_t)NULL}
 };
 
 
 static EventTableEntry keyEvents[] = {
 
     {"key",         KeyPress,    ParseKeySym,    0,  FALSE},
-    { NULL, (unsigned int)NULL, (Boolean(*)())NULL, (unsigned int)NULL, (Boolean)NULL}
+    { NULL, (unsigned int)(uintptr_t)NULL, (Boolean(*)())NULL, (unsigned int)(uintptr_t)NULL, (Boolean)(uintptr_t)NULL}
 };
 
 #ifdef PANELIST
@@ -4126,7 +4126,7 @@
          */
 
 #ifndef NO_MULTIBYTE
-	if ((wmFunction == F_Exec))
+	if (wmFunction == F_Exec)
 	{
 	    lastlen = 0;
 	    p = *pArgs;
diff -Nurd -x'*~' motif-2.3.4.orig/clients/mwm/WmWinConf.c motif-2.3.4/clients/mwm/WmWinConf.c
--- motif-2.3.4.orig/clients/mwm/WmWinConf.c	2012-10-22 10:50:39.000000000 -0400
+++ motif-2.3.4/clients/mwm/WmWinConf.c	2015-11-18 00:10:47.000000000 -0500
@@ -688,7 +688,7 @@
 {
     KeySym keysym;
     Boolean control;
-    int warpX, warpY, currentX, currentY, newX, newY;
+    int warpX, warpY, currentX = 0, currentY, newX, newY;
     int junk, keyMult;
     Window junk_win;
     XEvent KeyEvent;
diff -Nurd -x'*~' motif-2.3.4.orig/clients/uil/UilDB.c motif-2.3.4/clients/uil/UilDB.c
--- motif-2.3.4.orig/clients/uil/UilDB.c	2012-10-22 10:50:39.000000000 -0400
+++ motif-2.3.4/clients/uil/UilDB.c	2015-11-18 00:10:47.000000000 -0500
@@ -377,7 +377,7 @@
  *  Local variables
  */
 	int			return_num_items, i, string_size=0;
-	key_keytable_entry_type	*table;
+	key_keytable_entry_type	*table = NULL;
 	char			*string_table;
 	 
 	switch (header->table_id)
@@ -723,7 +723,7 @@
  *  Local variables
  */
 	int			return_num_items, i, int_table_size=0;
-	UilEnumSetDescDef	*table;
+	UilEnumSetDescDef	*table = NULL;
 	unsigned short int 	*int_table;
 	 
 	switch (header->table_id)
diff -Nurd -x'*~' motif-2.3.4.orig/clients/uil/UilP2Out.c motif-2.3.4/clients/uil/UilP2Out.c
--- motif-2.3.4.orig/clients/uil/UilP2Out.c	2012-10-22 10:50:39.000000000 -0400
+++ motif-2.3.4/clients/uil/UilP2Out.c	2015-11-18 00:10:47.000000000 -0500
@@ -1328,7 +1328,7 @@
 
 {
     MrmCode	    access;
-    int		    value_size;
+    int		    value_size = 0;
     MrmType	    value_type;
     int		    value_count;    
     char	    *buffer;
diff -Nurd -x'*~' motif-2.3.4.orig/clients/uil/UilSarExp.c motif-2.3.4/clients/uil/UilSarExp.c
--- motif-2.3.4.orig/clients/uil/UilSarExp.c	2012-10-22 10:50:39.000000000 -0400
+++ motif-2.3.4/clients/uil/UilSarExp.c	2015-11-18 00:10:47.000000000 -0500
@@ -128,7 +128,7 @@
 
 {
     sym_value_entry_type    *res_entry;
-    int	    		    operator;
+    int	    		    operator = 0;
 
     _assert( operator_frame->b_tag == sar_k_token_frame,
 	     "operator missing" );
@@ -258,7 +258,7 @@
 
 {
     sym_value_entry_type    *res_entry;
-    int			    operator;
+    int			    operator = 0;
     int			    res_type;
 
 
diff -Nurd -x'*~' motif-2.3.4.orig/clients/uil/UilSarObj.c motif-2.3.4/clients/uil/UilSarObj.c
--- motif-2.3.4.orig/clients/uil/UilSarObj.c	2012-10-22 10:50:39.000000000 -0400
+++ motif-2.3.4/clients/uil/UilSarObj.c	2015-11-18 00:10:47.000000000 -0500
@@ -206,7 +206,7 @@
 
     sym_name_entry_type		* name_entry;
     sym_obj_entry_type		* obj_entry;
-    int				node_size;
+    int				node_size = 0;
     yystype			* source_frame;
 
     source_frame = & yylval;
@@ -1385,7 +1385,7 @@
     yystype			* widget_frame;
     sym_widget_entry_type	* widget_entry;
     sym_entry_type		* feature_entry;
-    sym_entry_type		* * ptr;
+    sym_entry_type		* * ptr = NULL;
 
     yystype			* source_frame;
 
diff -Nurd -x'*~' motif-2.3.4.orig/clients/uil/UilSarVal.c motif-2.3.4/clients/uil/UilSarVal.c
--- motif-2.3.4.orig/clients/uil/UilSarVal.c	2012-10-22 10:50:39.000000000 -0400
+++ motif-2.3.4/clients/uil/UilSarVal.c	2015-11-18 00:10:47.000000000 -0500
@@ -244,7 +244,7 @@
 
 	if (name_entry == NULL)
 	{
-	    int	    source_type;
+	    int	    source_type = 0;
 	    unsigned short int	arg_code;
 	    unsigned short int	rel_code;
 
@@ -549,7 +549,7 @@
 int	    arg_type;
 
 {
-    sym_value_entry_type    *value_entry;
+    sym_value_entry_type    *value_entry = NULL;
     /*
     **	This should be a long because the call to sem_create_value_entry passes the sizeof(long).   This also
     **	maps on top of value.l_integer which is a long and is used in sar_chk_comp_str_attr.
@@ -2534,7 +2534,7 @@
 yystype	    *keyword_frame;
 
 {
-    sym_value_entry_type    *font_table_entry;
+    sym_value_entry_type    *font_table_entry = NULL;
     sym_value_entry_type    *font_item;
 
     _assert( font_frame->b_tag == sar_k_value_frame, "font item missing" );
@@ -3208,7 +3208,7 @@
 
 {
     sym_color_item_entry_type   *item_entry;
-    sym_color_item_entry_type   *prior_item_entry;
+    sym_color_item_entry_type   *prior_item_entry = NULL;
 
     /*
     **	Tag for the prior_target frame indicates if this is the first
@@ -3325,8 +3325,8 @@
 
 {
     sym_color_item_entry_type   *next_item_entry;
-    sym_value_entry_type	*color_table_entry;
-    int				target_type;
+    sym_value_entry_type	*color_table_entry = NULL;
+    int				target_type = 0;
 
     /*
     **	Tag for the list frame indicates if there are any color items.
@@ -3478,7 +3478,7 @@
 {
     sym_value_entry_type    *color_entry;
     sym_value_entry_type    *value_entry;
-    int			    state;
+    int			    state = 0;
 
     /*
     **	Mono frame can point to the keyword FOREGROUND or BACKGROUND
diff -Nurd -x'*~' motif-2.3.4.orig/clients/uil/UilSemVal.c motif-2.3.4/clients/uil/UilSemVal.c
--- motif-2.3.4.orig/clients/uil/UilSemVal.c	2012-10-22 10:50:39.000000000 -0400
+++ motif-2.3.4/clients/uil/UilSemVal.c	2015-11-18 00:10:47.000000000 -0500
@@ -722,7 +722,7 @@
 key_keytable_entry_type		*keytable_entry;
 sym_argument_entry_type		**seen_entry;
 boolean				supported_flag;
-unsigned char			expected_type, actual_type, actual_tag;
+unsigned char			expected_type, actual_type = '\0', actual_tag;
 boolean				valid_value;
 
 
diff -Nurd -x'*~' motif-2.3.4.orig/configure.ac motif-2.3.4/configure.ac
--- motif-2.3.4.orig/configure.ac	2012-10-22 10:50:39.000000000 -0400
+++ motif-2.3.4/configure.ac	2015-11-18 10:22:30.000000000 -0500
@@ -1,14 +1,8 @@
 dnl Process this file with autoconf to produce a configure script.
-AC_INIT
+AC_INIT([motif],[2.3.4])
 AC_CONFIG_SRCDIR([lib/Xm/Form.c])
 AC_PREREQ(2.52)
 AC_CONFIG_AUX_DIR(.)
-AC_CHECK_FILE(/usr/X/include/X11/X.h,
-  AC_PREFIX_DEFAULT(/usr/X),
-  AC_PREFIX_DEFAULT(/usr))
-AC_CHECK_FILE(/usr/X11R6/include/X11/X.h,
-  AC_PREFIX_DEFAULT(/usr/X11R6),
-  AC_PREFIX_DEFAULT(/usr))
 
 dnl AM_MAINTAINER_MODE
 AC_CANONICAL_TARGET
@@ -22,7 +16,7 @@
 AC_SUBST(AGE)
 
 dnl This is really dumb but it seems to be bug
-AM_INIT_AUTOMAKE(motif,2.3.4,no-define)
+AM_INIT_AUTOMAKE([no-define])
 
 LIBTOOL_VERSION=$CURRENT:$REVISION:$AGE
 
@@ -66,15 +60,18 @@
 
 dnl Checks for Xos_r.h
 
+save_CPPFLAGS=$CPPFLAGS
+CPPFLAGS="$CPPFLAGS $X_CFLAGS"
 AC_CHECK_HEADERS([X11/Xos_r.h])
 AC_CHECK_HEADERS([X11/Xpoll.h])
+CPPFLAGS=$save_CPPFLAGS
 
 dnl Compile in EditRes support if we can find Xmu
 
 save_LIBS="$LIBS"
 save_CFLAGS="$CFLAGS"
-LIBS="$X_LIBS $LIBS"
-CFLAGS="$X_CFLAGS $CFLAGS"
+LIBS="$LIBS $X_LIBS"
+CFLAGS="$CFLAGS $X_CFLAGS"
 AC_CHECK_HEADERS(X11/Xmu/Editres.h,
 AC_CHECK_LIB(Xmu, _XEditResCheckMessages,
 X_XMU=-lXmu
@@ -99,8 +96,11 @@
 AC_CHECK_HEADERS(fcntl.h limits.h malloc.h sys/malloc.h strings.h sys/file.h sys/time.h unistd.h wchar.h)
 AC_CHECK_HEADERS(wctype.h, AC_DEFINE(HAS_WIDECHAR_FUNCTIONS,1,System supports wchar))
 AC_CHECK_HEADER(langinfo.h,,AC_DEFINE(CSRG_BASED,1,System Has langinfo.h))
+save_CPPFLAGS=$CPPFLAGS
+CPPFLAGS="$CPPFLAGS $X_CFLAGS"
 AC_CHECK_HEADER(X11/Xos_r.h,,AC_DEFINE(NEED_XOS_R_H,1,System Missing Xos_r.h))
 AC_CHECK_HEADER(X11/Xpoll.h,,AC_DEFINE(NEED_XPOLL_H,1,system Missing X11/Xpoll.h))
+CPPFLAGS=$save_CPPFLAGS
 dnl Checks for typedefs, structures, and compiler characteristics.
 AC_C_CONST
 AC_TYPE_MODE_T
@@ -127,7 +127,10 @@
 AC_CHECK_FUNCS(putenv,,AC_DEFINE(NO_PUTENV, 1, No PUTENV))
 AC_CHECK_FUNCS(regcomp,,AC_DEFINE(NO_REGCOMP, 1, no regcmp))
 AC_CHECK_FUNCS(memmove,,AC_DEFINE(NO_MEMMOVE, 1, no memmove))
+save_CPPFLAGS=$CPPFLAGS
+CPPFLAGS="$CPPFLAGS $X_CFLAGS"
 AC_CHECK_TYPE(XICProc,,AC_DEFINE(NO_XICPROC, 1, XICProc isn't defined), [#include <X11/Xlib.h>])
+CPPFLAGS=$save_CPPFLAGS
 
 AC_ARG_ENABLE(message-catalog, [  --enable-message-catalog
                           Enable building of the message catalog (default=no)])
@@ -164,9 +167,6 @@
 if test x$GCC = xyes
 then
     CFLAGS="$CFLAGS -Wall -g -fno-strict-aliasing -Wno-unused -Wno-comment"
-    if test ` $CC -dumpversion | sed -e 's/\(^.\).*/\1/'` = "4" ; then
-        CFLAGS="$CFLAGS -fno-tree-ter"
-    fi
 fi
 AC_DEFINE(NO_OL_COMPAT, 1, "No OL Compatability")
 
@@ -255,9 +255,19 @@
 if test "$enable_printing" = "yes"
 then
   AC_MSG_CHECKING([for libXp])
+  save_CPPFLAGS=$CPPFLAGS
+  save_LDFLAGS=$LDFLAGS
+  save_LIBS=$LIBS	# AC_CHECK_LIB adds -l if found
+  CPPFLAGS="$CPPFLAGS $X_CFLAGS"
+  LDFLAGS="$LDFLAGS $X_LIBS"
   AC_CHECK_HEADERS(X11/extensions/Print.h,
     AC_CHECK_LIB(Xp, XpCreateContext, ,enable_printing="no"),
   enable_printing="no")
+  CPPFLAGS=$save_CPPFLAGS
+  LDFLAGS=$save_LDFLAGS
+  LIBS=$save_LIBS	# -lXp propagated by alt variable (below)...no
+			# x11 -L in LIBS, so later tests that use LIBS
+			# fail because -lXp cannot be resolved
 fi
 
 if test "$enable_printing" = "yes"
diff -Nurd -x'*~' motif-2.3.4.orig/lib/Mrm/Mrmhier.c motif-2.3.4/lib/Mrm/Mrmhier.c
--- motif-2.3.4.orig/lib/Mrm/Mrmhier.c	2012-10-22 10:50:34.000000000 -0400
+++ motif-2.3.4/lib/Mrm/Mrmhier.c	2015-11-18 00:10:47.000000000 -0500
@@ -264,10 +264,10 @@
 	    case MrmSUCCESS:
 	      break;
 	    case MrmNOT_VALID:
-	      sprintf (err_stg, _MrmMMsg_0113);
+	      sprintf (err_stg, "%s", _MrmMMsg_0113);
 	      break;
 	    default:
-	      sprintf (err_stg, _MrmMMsg_0114);
+	      sprintf (err_stg, "%s", _MrmMMsg_0114);
 	      break;
 	    }
 	}
diff -Nurd -x'*~' motif-2.3.4.orig/lib/Mrm/Mrmicon.c motif-2.3.4/lib/Mrm/Mrmicon.c
--- motif-2.3.4.orig/lib/Mrm/Mrmicon.c	2012-10-22 10:50:34.000000000 -0400
+++ motif-2.3.4/lib/Mrm/Mrmicon.c	2015-11-18 00:10:47.000000000 -0500
@@ -1176,7 +1176,7 @@
 		}
 		break;
 	      default:
-		sprintf(err_msg, _MrmMMsg_0040);
+		sprintf(err_msg, "%s", _MrmMMsg_0040);
 		return Urm__UT_Error ("Urm__RelizeColorTable",
 				      err_msg, NULL, NULL, MrmFAILURE) ;
 	      }
@@ -1252,7 +1252,7 @@
 	      break;
 	    default:
 	      result = MrmFAILURE;
-	      sprintf (err_msg, _MrmMMsg_0040);
+	      sprintf (err_msg, "%s", _MrmMMsg_0040);
 	      Urm__UT_Error ("Urm__RelizeColorTable",
 			     err_msg, NULL, NULL, MrmFAILURE) ;
 	    }
diff -Nurd -x'*~' motif-2.3.4.orig/lib/Mrm/Mrmlread.c motif-2.3.4/lib/Mrm/Mrmlread.c
--- motif-2.3.4.orig/lib/Mrm/Mrmlread.c	2012-10-22 10:50:34.000000000 -0400
+++ motif-2.3.4/lib/Mrm/Mrmlread.c	2015-11-18 00:10:47.000000000 -0500
@@ -698,7 +698,7 @@
 	 XBlackPixelOfScreen(XDefaultScreenOfDisplay(display)));
       break;
     default:
-      sprintf(err_msg, _MrmMMsg_0040);
+      sprintf(err_msg, "%s", _MrmMMsg_0040);
       result = Urm__UT_Error ("MrmFetchColorLiteral",
 			      err_msg, NULL, NULL, MrmFAILURE) ;
       _MrmAppUnlock(app);
diff -Nurd -x'*~' motif-2.3.4.orig/lib/Mrm/Mrmwcrw.c motif-2.3.4/lib/Mrm/Mrmwcrw.c
--- motif-2.3.4.orig/lib/Mrm/Mrmwcrw.c	2012-10-22 10:50:34.000000000 -0400
+++ motif-2.3.4/lib/Mrm/Mrmwcrw.c	2015-11-18 00:10:47.000000000 -0500
@@ -1341,7 +1341,7 @@
 	       */ 
 	      if (reptype == MrmRtypeColor)
 		{
-		  Pixel pix;
+		  Pixel pix = 0;
 		  RGMColorDescPtr colorptr;
 		  Colormap cmap;
 
@@ -1390,7 +1390,7 @@
 			}
 		      break;
 		    default:
-		      sprintf (err_msg, _MrmMMsg_0040);
+		      sprintf (err_msg, "%s", _MrmMMsg_0040);
 		      result = Urm__UT_Error ("Urm__CW_ConvertValue",
 					      err_msg, NULL, NULL, MrmFAILURE) ;
 		    };
@@ -2426,7 +2426,7 @@
 	    }
 	  break;
 	default:
-	  sprintf(err_msg, _MrmMMsg_0040);
+	  sprintf(err_msg, "%s", _MrmMMsg_0040);
 	  return Urm__UT_Error ("Urm__CW_ConvertValue",
 				err_msg, NULL, NULL, MrmFAILURE) ;
 	};
diff -Nurd -x'*~' motif-2.3.4.orig/lib/Xm/BaseClass.c motif-2.3.4/lib/Xm/BaseClass.c
--- motif-2.3.4.orig/lib/Xm/BaseClass.c	2012-10-22 10:50:37.000000000 -0400
+++ motif-2.3.4/lib/Xm/BaseClass.c	2015-11-18 00:10:47.000000000 -0500
@@ -564,7 +564,7 @@
   static ExtToContextRec extToContextMap[16];
   Cardinal		 i;
   ExtToContext		 curr;
-  XContext		 context = (XContext) NULL;
+  XContext		 context = (XContext)(uintptr_t) NULL;
   
   _XmProcessLock();
   for (i = 0, curr = &extToContextMap[0];
diff -Nurd -x'*~' motif-2.3.4.orig/lib/Xm/Container.c motif-2.3.4/lib/Xm/Container.c
--- motif-2.3.4.orig/lib/Xm/Container.c	2012-10-22 10:50:37.000000000 -0400
+++ motif-2.3.4/lib/Xm/Container.c	2015-11-18 00:10:47.000000000 -0500
@@ -3234,7 +3234,7 @@
 	    ContainerResetDepths(nc);
 
 #ifdef FIX_1425
-		FindMaxDepths(cc, cw);
+		FindMaxDepths(cc, (struct _WidgetRec *)cw);
 #else
 	    cw->container.max_depth = MAX(cw->container.max_depth,nc->depth);
 #endif
@@ -7181,7 +7181,7 @@
 		Widget child = node->widget_ptr;
 		XmContainerConstraint cc = GetContainerConstraint(child);
 		cw->container.max_depth = MAX(cw->container.max_depth, cc->depth);
-		FindMaxDepths(cc, cw);
+		FindMaxDepths(cc, (struct _WidgetRec *)cw);
 		node = node->next_ptr;
 	}
 }
diff -Nurd -x'*~' motif-2.3.4.orig/lib/Xm/DataF.c motif-2.3.4/lib/Xm/DataF.c
--- motif-2.3.4.orig/lib/Xm/DataF.c	2012-10-22 10:50:34.000000000 -0400
+++ motif-2.3.4/lib/Xm/DataF.c	2015-11-18 00:10:47.000000000 -0500
@@ -9218,7 +9218,7 @@
       /* CR03685 */
       SGI_hack_XmImRegister((Widget)tf);
 #else
-      XmImRegister((Widget)tf, (unsigned int) NULL);
+      XmImRegister((Widget)tf, (unsigned int)(uintptr_t) NULL);
 #endif
       df_GetXYFromPos(tf, XmTextF_cursor_position(tf), &xmim_point.x, &xmim_point.y);
       n = 0;
@@ -10728,7 +10728,7 @@
            diff_values = True;
            if (XmTextF_wc_value(new_tf) == NULL) {
               XmTextF_wc_value(new_tf) = (wchar_t*) XtMalloc(sizeof(wchar_t));
-              *XmTextF_wc_value(new_tf) = (wchar_t)NULL;
+              *XmTextF_wc_value(new_tf) = (wchar_t)(uintptr_t)NULL;
            }
            df_ValidateString(new_tf, (char*)XmTextF_wc_value(new_tf), True);
         } else if (XmTextF_value(new_tf) != XmTextF_value(old_tf)) {
@@ -11874,7 +11874,7 @@
        /* CR03685 */
        SGI_hack_XmImRegister((Widget)tf);
 #else
-       XmImRegister((Widget)tf, (unsigned int) NULL);
+       XmImRegister((Widget)tf, (unsigned int)(uintptr_t) NULL);
 #endif
        df_GetXYFromPos(tf, XmTextF_cursor_position(tf), &xmim_point.x, 
 		       &xmim_point.y);
diff -Nurd -x'*~' motif-2.3.4.orig/lib/Xm/DragBS.c motif-2.3.4/lib/Xm/DragBS.c
--- motif-2.3.4.orig/lib/Xm/DragBS.c	2012-10-22 10:50:34.000000000 -0400
+++ motif-2.3.4/lib/Xm/DragBS.c	2015-11-18 00:10:47.000000000 -0500
@@ -204,9 +204,9 @@
 static unsigned long	firstProtectRequest;
 static Window		errorWindow;
 
-static XContext 	displayToMotifWindowContext = (XContext) NULL;
-static XContext 	displayToTargetsContext = (XContext) NULL;
-static XContext		displayToAtomsContext = (XContext) NULL;
+static XContext 	displayToMotifWindowContext = (XContext)(uintptr_t) NULL;
+static XContext 	displayToTargetsContext = (XContext)(uintptr_t) NULL;
+static XContext		displayToAtomsContext = (XContext)(uintptr_t) NULL;
 
 
 /*****************************************************************************
@@ -291,7 +291,7 @@
     XContext	loc_context;
 
     _XmProcessLock();
-    if (displayToMotifWindowContext == (XContext) NULL) {
+    if (displayToMotifWindowContext == (XContext)(uintptr_t) NULL) {
         displayToMotifWindowContext = XUniqueContext();
     }
     loc_context = displayToMotifWindowContext;
@@ -322,7 +322,7 @@
     XContext loc_context;
 
     _XmProcessLock();
-    if (displayToMotifWindowContext == (XContext) NULL) {
+    if (displayToMotifWindowContext == (XContext)(uintptr_t) NULL) {
         displayToMotifWindowContext = XUniqueContext();
     }
     loc_context = displayToMotifWindowContext;
@@ -365,7 +365,7 @@
     XContext		loc_context;
 
     _XmProcessLock();
-    if (displayToTargetsContext == (XContext) NULL) {
+    if (displayToTargetsContext == (XContext)(uintptr_t) NULL) {
         displayToTargetsContext = XUniqueContext();
     }
     loc_context = displayToTargetsContext;
@@ -396,7 +396,7 @@
     XContext	loc_context;
 
     _XmProcessLock();
-    if (displayToTargetsContext == (XContext) NULL) {
+    if (displayToTargetsContext == (XContext)(uintptr_t) NULL) {
         displayToTargetsContext = XUniqueContext();
     }
     loc_context = displayToTargetsContext;
@@ -451,7 +451,7 @@
     XContext		loc_context;
 
     _XmProcessLock();
-    if (displayToAtomsContext == (XContext) NULL) {
+    if (displayToAtomsContext == (XContext)(uintptr_t) NULL) {
 	displayToAtomsContext = XUniqueContext();
     }
     loc_context = displayToAtomsContext;
@@ -482,7 +482,7 @@
     XContext loc_context;
 
     _XmProcessLock();
-    if (displayToAtomsContext == (XContext) NULL) {
+    if (displayToAtomsContext == (XContext)(uintptr_t) NULL) {
         displayToAtomsContext = XUniqueContext();
     }
     loc_context = displayToAtomsContext;
diff -Nurd -x'*~' motif-2.3.4.orig/lib/Xm/DragIcon.c motif-2.3.4/lib/Xm/DragIcon.c
--- motif-2.3.4.orig/lib/Xm/DragIcon.c	2012-10-22 10:50:34.000000000 -0400
+++ motif-2.3.4/lib/Xm/DragIcon.c	2015-11-18 00:10:47.000000000 -0500
@@ -747,7 +747,7 @@
 #undef Offset
 #define Offset(x) (XtOffsetOf( struct _XmDragIconRec, drag.x))
 
-static XContext _XmTextualDragIconContext = (XContext) NULL;
+static XContext _XmTextualDragIconContext = (XContext)(uintptr_t) NULL;
 
 static XtResource resources[]=
 {
@@ -1227,7 +1227,7 @@
    use_alt = dpy -> display.enable_drag_icon;
 
    _XmProcessLock();
-   if (_XmTextualDragIconContext == (XContext) NULL)
+   if (_XmTextualDragIconContext == (XContext)(uintptr_t) NULL)
       _XmTextualDragIconContext = XUniqueContext();
    loc_context = _XmTextualDragIconContext;
    _XmProcessUnlock();
diff -Nurd -x'*~' motif-2.3.4.orig/lib/Xm/DropSMgr.c motif-2.3.4/lib/Xm/DropSMgr.c
--- motif-2.3.4.orig/lib/Xm/DropSMgr.c	2012-10-22 10:50:35.000000000 -0400
+++ motif-2.3.4/lib/Xm/DropSMgr.c	2015-11-18 00:10:47.000000000 -0500
@@ -4279,7 +4279,7 @@
 	                         XtDisplayOfObject(widget)));
     info = DSMWidgetToInfo(dsm, widget);
 
-    if ((info == NULL)) {
+    if (info == NULL) {
 	_XmAppUnlock(app);
 	return False;
     }
diff -Nurd -x'*~' motif-2.3.4.orig/lib/Xm/FontS.c motif-2.3.4/lib/Xm/FontS.c
--- motif-2.3.4.orig/lib/Xm/FontS.c	2012-10-22 10:50:36.000000000 -0400
+++ motif-2.3.4/lib/Xm/FontS.c	2015-11-18 00:10:47.000000000 -0500
@@ -1879,7 +1879,7 @@
 		String params[1];
 		Cardinal num = 1;
 		
-		params[1] = new_font;
+		params[0] = new_font;
 		dbg(); _XmWarningMsg((Widget) fsw, XmNbadXlfdFont,
 			XmNbadXlfdFontMsg, params, num);
 	    }
@@ -2764,7 +2764,7 @@
 	XmStringFree(label);
 
 	XtAddCallback(button,
-		      XmNactivateCallback, ChangeEncoding, (XtPointer) i);
+		      XmNactivateCallback, ChangeEncoding, (XtPointer)(uintptr_t) i);
 
 	if (streq(*encodings, ENCODING_STRING(fsw)))
 	{
@@ -2926,7 +2926,7 @@
     fsw = (XmFontSelectorWidget) w;
     cf = XmFontS_font_info(fsw)->current_font;
 
-    if ((int) data == 0)
+    if ((int)(uintptr_t) data == 0)
 	{
 	XtFree(ENCODING_STRING(fsw));
 	ENCODING_STRING(fsw) = XtNewString(ANY_ENCODING);
@@ -2934,7 +2934,7 @@
     else
 	{
 	XtFree(ENCODING_STRING(fsw));
-	ENCODING_STRING(fsw) = XtNewString(ENCODING_LIST(fsw)[(int) data - 1]);
+	ENCODING_STRING(fsw) = XtNewString(ENCODING_LIST(fsw)[(int)(uintptr_t) data - 1]);
 	}
 
     UpdateFamilies(fsw);
@@ -3692,7 +3692,7 @@
 	    num_largs = 0;
 	    XtSetArg(largs[num_largs], XmNmenuHistory, button); num_largs++;
 	    XtSetValues(XmFontS_option_menu(set_fsw), largs, num_largs);
-	    ChangeEncoding((Widget) set_fsw, (XtPointer) current, NULL);
+	    ChangeEncoding((Widget) set_fsw, (XtPointer)(uintptr_t) current, NULL);
 	}
 	else
 	{
diff -Nurd -x'*~' motif-2.3.4.orig/lib/Xm/I18List.c motif-2.3.4/lib/Xm/I18List.c
--- motif-2.3.4.orig/lib/Xm/I18List.c	2012-10-22 10:50:37.000000000 -0400
+++ motif-2.3.4/lib/Xm/I18List.c	2015-11-18 00:10:47.000000000 -0500
@@ -2388,7 +2388,7 @@
     Arg args[5];
     Cardinal num_args=0;
     register int i, height, max_width, rows_per_screen;
-    register int slide_pos, slide_size, col_width=0, min=0;
+    register int slide_pos = 0, slide_size, col_width=0, min=0;
 
     /*
      * Get maximum width of data to display
diff -Nurd -x'*~' motif-2.3.4.orig/lib/Xm/IconButton.c motif-2.3.4/lib/Xm/IconButton.c
--- motif-2.3.4.orig/lib/Xm/IconButton.c	2012-10-22 10:50:34.000000000 -0400
+++ motif-2.3.4/lib/Xm/IconButton.c	2015-11-18 00:10:47.000000000 -0500
@@ -1870,7 +1870,7 @@
 
 #ifdef FIX_1381
     /*generally gray insensitive foreground (instead stipple)*/
-    values.foreground = _XmAssignInsensitiveColor(iw);
+    values.foreground = _XmAssignInsensitiveColor((struct _WidgetRec *)iw);
     XmIconButton_insensitive_text_gc(iw) = XtGetGC(w, smask, &values);
 #else 
     XmIconButton_stippled_text_gc(iw) = XtGetGC(w, smask, &values);
diff -Nurd -x'*~' motif-2.3.4.orig/lib/Xm/IconG.c motif-2.3.4/lib/Xm/IconG.c
--- motif-2.3.4.orig/lib/Xm/IconG.c	2012-10-22 10:50:35.000000000 -0400
+++ motif-2.3.4/lib/Xm/IconG.c	2015-11-18 00:10:47.000000000 -0500
@@ -267,8 +267,8 @@
 
 /* those are created in ClassInitialize and filled by the
    IconConverter. */
-static XContext 	largeIconContext = (XContext) NULL;
-static XContext		smallIconContext = (XContext) NULL;
+static XContext 	largeIconContext = (XContext)(uintptr_t) NULL;
+static XContext		smallIconContext = (XContext)(uintptr_t) NULL;
 
 static XPointer dummy;
 #define OwnLargeMask(widget) \
diff -Nurd -x'*~' motif-2.3.4.orig/lib/Xm/Label.c motif-2.3.4/lib/Xm/Label.c
--- motif-2.3.4.orig/lib/Xm/Label.c	2012-10-22 10:50:34.000000000 -0400
+++ motif-2.3.4/lib/Xm/Label.c	2015-11-18 00:10:47.000000000 -0500
@@ -1562,7 +1562,7 @@
 #ifdef FIX_1505
 	      if (pix_use == Pix(lw)) {
 		  XSetFillStyle(XtDisplay(lw), gc, FillStippled);
-		  XSetStipple(XtDisplay(lw), gc, _XmGetInsensitiveStippleBitmap(lw));
+		  XSetStipple(XtDisplay(lw), gc, _XmGetInsensitiveStippleBitmap((struct _WidgetRec *)lw));
 		  XFillRectangle(XtDisplay(lw), XtWindow(lw), gc,
 			lp->TextRect.x + lp->PixmapRect.x,
 			lp->TextRect.y + lp->PixmapRect.y,
diff -Nurd -x'*~' motif-2.3.4.orig/lib/Xm/LabelG.c motif-2.3.4/lib/Xm/LabelG.c
--- motif-2.3.4.orig/lib/Xm/LabelG.c	2012-10-22 10:50:37.000000000 -0400
+++ motif-2.3.4/lib/Xm/LabelG.c	2015-11-18 00:10:47.000000000 -0500
@@ -2452,7 +2452,7 @@
 #ifdef FIX_1505
                 if (pix_use == Pix(lw)) {
                     XSetFillStyle(XtDisplay(lw), gc, FillStippled);
-                    XSetStipple(XtDisplay(lw), gc, _XmGetInsensitiveStippleBitmap(lw));
+                    XSetStipple(XtDisplay(lw), gc, _XmGetInsensitiveStippleBitmap((struct _WidgetRec *)lw));
                     XFillRectangle(XtDisplay(lw), XtWindow(lw), gc,
                        lw->rectangle.x + LabG_TextRect(lw).x +
                        LabG_PixmapRect(lw).x,
diff -Nurd -x'*~' motif-2.3.4.orig/lib/Xm/List.c motif-2.3.4/lib/Xm/List.c
--- motif-2.3.4.orig/lib/Xm/List.c	2012-10-22 10:50:37.000000000 -0400
+++ motif-2.3.4/lib/Xm/List.c	2015-11-18 00:10:47.000000000 -0500
@@ -2486,7 +2486,7 @@
 #ifdef FIX_1381
 	  {
 		gc = lw->list.InsensitiveGC;
-		_XmRendFG(lw->list.scratchRend) = _XmAssignInsensitiveColor(lw);
+		_XmRendFG(lw->list.scratchRend) = _XmAssignInsensitiveColor((struct _WidgetRec *)lw);
 	  }
 #else
 	gc = lw->list.InsensitiveGC;
@@ -2831,7 +2831,7 @@
   values.background = lw->core.background_pixel;
 #ifdef FIX_1381
   /*generally gray insensitive foreground (instead stipple)*/
-  values.foreground = _XmAssignInsensitiveColor(lw);
+  values.foreground = _XmAssignInsensitiveColor((struct _WidgetRec *)lw);
 #else
   values.foreground = lw->primitive.foreground;
   valueMask |= GCStipple | GCFillStyle;
diff -Nurd -x'*~' motif-2.3.4.orig/lib/Xm/MainW.c motif-2.3.4/lib/Xm/MainW.c
--- motif-2.3.4.orig/lib/Xm/MainW.c	2012-10-22 10:50:38.000000000 -0400
+++ motif-2.3.4/lib/Xm/MainW.c	2015-11-18 00:10:47.000000000 -0500
@@ -1274,7 +1274,7 @@
     /* The first rectangle is the one that makes the scrollbar goes up */
     (*vrect)[0].x = w->core.x - mw->swindow.vScrollBar->core.x ;
     /* just translate to the scrollbar coordinate */
-    (*vrect)[0].y =- mw->swindow.vScrollBar->core.y ;
+    (*vrect)[0].y -= mw->swindow.vScrollBar->core.y ;
     (*vrect)[0].width = w->core.width ;
 
     /* The second rectangle is the one that makes the scrollbar goes down */
diff -Nurd -x'*~' motif-2.3.4.orig/lib/Xm/Obso2_0.c motif-2.3.4/lib/Xm/Obso2_0.c
--- motif-2.3.4.orig/lib/Xm/Obso2_0.c	2012-10-22 10:50:34.000000000 -0400
+++ motif-2.3.4/lib/Xm/Obso2_0.c	2015-11-18 00:10:47.000000000 -0500
@@ -1571,7 +1571,7 @@
   Stuff from Desktop.c
 **********************/
 
-static XContext	actualClassContext = (XContext) NULL;
+static XContext	actualClassContext = (XContext)(uintptr_t) NULL;
 
 
 /*ARGSUSED*/
@@ -1598,7 +1598,7 @@
 {
 	  WidgetClass		actualClass;
 
-	  if (actualClassContext == (XContext) NULL)
+	  if (actualClassContext == (XContext)(uintptr_t) NULL)
 	    actualClassContext = XUniqueContext();
 	  
 	  /*
@@ -1632,7 +1632,7 @@
     WidgetClass previous;
     WidgetClass oldActualClass;
 
-    if (actualClassContext == (XContext) NULL)
+    if (actualClassContext == (XContext)(uintptr_t) NULL)
       actualClassContext = XUniqueContext();
     
     /*
@@ -1679,7 +1679,7 @@
         Cardinal *num_args )
 {
     XmDesktopObject	worldObject;
-    static XContext	worldObjectContext = (XContext) NULL;
+    static XContext	worldObjectContext = (XContext)(uintptr_t) NULL;
     XmWidgetExtData     ext;
     Display		*display;
     
@@ -1688,7 +1688,7 @@
     ** the display is closed, so that we don't get bad data if a second 
     ** display with the same id is opened.
     */
-    if (worldObjectContext == (XContext) NULL)
+    if (worldObjectContext == (XContext)(uintptr_t) NULL)
       worldObjectContext = XUniqueContext();
 
     display = XtDisplayOfObject(shell);
diff -Nurd -x'*~' motif-2.3.4.orig/lib/Xm/Protocols.c motif-2.3.4/lib/Xm/Protocols.c
--- motif-2.3.4.orig/lib/Xm/Protocols.c	2012-10-22 10:50:34.000000000 -0400
+++ motif-2.3.4/lib/Xm/Protocols.c	2015-11-18 00:10:47.000000000 -0500
@@ -123,7 +123,7 @@
  *
  ***************************************************************************/
 
-static XContext	allProtocolsMgrContext = (XContext) NULL;
+static XContext	allProtocolsMgrContext = (XContext)(uintptr_t) NULL;
 
 
 #define Offset(field) XtOffsetOf( struct _XmProtocolRec, protocol.field)
@@ -361,7 +361,7 @@
 	  display = XtDisplay(shell);
 	  
 	  _XmProcessLock();
-	  if (allProtocolsMgrContext == (XContext) NULL)
+	  if (allProtocolsMgrContext == (XContext)(uintptr_t) NULL)
 	    allProtocolsMgrContext = XUniqueContext();
 	  _XmProcessUnlock();
 	  
diff -Nurd -x'*~' motif-2.3.4.orig/lib/Xm/ResConvert.c motif-2.3.4/lib/Xm/ResConvert.c
--- motif-2.3.4.orig/lib/Xm/ResConvert.c	2012-10-22 10:50:34.000000000 -0400
+++ motif-2.3.4/lib/Xm/ResConvert.c	2015-11-18 00:10:47.000000000 -0500
@@ -997,7 +997,7 @@
     char *delim )
 {
     char *fontName;
-    char *fontTag;
+    char *fontTag = NULL;
     char *fontPtr;
     String params[2];
     Cardinal num_params;
diff -Nurd -x'*~' motif-2.3.4.orig/lib/Xm/SlideC.c motif-2.3.4/lib/Xm/SlideC.c
--- motif-2.3.4.orig/lib/Xm/SlideC.c	2012-10-22 10:50:35.000000000 -0400
+++ motif-2.3.4/lib/Xm/SlideC.c	2015-11-18 00:10:47.000000000 -0500
@@ -110,14 +110,14 @@
 /* notify that initialize called    XtArgsProc        */ NULL,
 /* NULL                             XtProc            */ NULL,
 /* NULL                             XtPointer         */ NULL,
-/* NULL                             Cardinal          */ (Cardinal)NULL,
+/* NULL                             Cardinal          */ (Cardinal)(uintptr_t)NULL,
 /* resources for subclass fields    XtResourceList    */ resources,
 /* number of entries in resources   Cardinal          */ XtNumber(resources),
 /* resource class quarkified        XrmClass          */ NULLQUARK,
-/* NULL                             Boolean           */ (Boolean)NULL,
-/* NULL                             XtEnum            */ (XtEnum)NULL,
-/* NULL				    Boolean           */ (Boolean)NULL,
-/* NULL                             Boolean           */ (Boolean)NULL,
+/* NULL                             Boolean           */ (Boolean)(uintptr_t)NULL,
+/* NULL                             XtEnum            */ (XtEnum)(uintptr_t)NULL,
+/* NULL				    Boolean           */ (Boolean)(uintptr_t)NULL,
+/* NULL                             Boolean           */ (Boolean)(uintptr_t)NULL,
 /* free data for subclass pointers  XtWidgetProc      */ destroy,
 /* NULL                             XtProc            */ NULL,
 /* NULL			            XtProc            */ NULL,
diff -Nurd -x'*~' motif-2.3.4.orig/lib/Xm/Synthetic.c motif-2.3.4/lib/Xm/Synthetic.c
--- motif-2.3.4.orig/lib/Xm/Synthetic.c	2012-10-22 10:50:34.000000000 -0400
+++ motif-2.3.4/lib/Xm/Synthetic.c	2015-11-18 00:10:47.000000000 -0500
@@ -186,7 +186,7 @@
   
   for (i = 0; i < num_resources; i++)
     resources[i].resource_name = 
-      (String) XrmPermStringToQuark (resources[i].resource_name);
+      (String)(uintptr_t) XrmPermStringToQuark (resources[i].resource_name);
 }
 
 /**********************************************************************
@@ -230,7 +230,7 @@
       for (j = 0; j < num_resources; j++) 
 	{
 	  if ((resources[j].export_proc) &&
-	      (XrmQuark)(resources[j].resource_name) == quark) 
+	      (XrmQuark)(uintptr_t)(resources[j].resource_name) == quark) 
 	    {
 	      value_size = resources[j].resource_size;
 
@@ -505,7 +505,7 @@
       for (j = 0; j < num_resources; j++) 
 	{
 	  if ((resources[j].import_proc) &&
-	      (XrmQuark)(resources[j].resource_name) == quark) 
+	      (XrmQuark)(uintptr_t)(resources[j].resource_name) == quark) 
 	    {
 	      value = args[i].value;
 	      
diff -Nurd -x'*~' motif-2.3.4.orig/lib/Xm/TabBox.c motif-2.3.4/lib/Xm/TabBox.c
--- motif-2.3.4.orig/lib/Xm/TabBox.c	2012-10-22 10:50:37.000000000 -0400
+++ motif-2.3.4/lib/Xm/TabBox.c	2015-11-18 00:10:47.000000000 -0500
@@ -7617,7 +7617,7 @@
 {
     XmTabbedStackList       list = XmTabBox_tab_list(tab);
     int             i, count = _XmTabbedStackListCount(list), row = 0, col,
-                    shadow = tab->manager.shadow_thickness, x,
+                    shadow = tab->manager.shadow_thickness, x = 0,
                     height, offset, idx, below, corner, cnt, first, last,
                     x1, x2;
     XmTabAttributes info;
diff -Nurd -x'*~' motif-2.3.4.orig/lib/Xm/Text.c motif-2.3.4/lib/Xm/Text.c
--- motif-2.3.4.orig/lib/Xm/Text.c	2012-10-22 10:50:38.000000000 -0400
+++ motif-2.3.4/lib/Xm/Text.c	2015-11-18 00:10:47.000000000 -0500
@@ -642,14 +642,14 @@
 static void 
 _XmCreateCutBuffers(Widget w)
 {
-  static XContext context = (XContext)NULL;
+  static XContext context = (XContext)(uintptr_t)NULL;
   char * tmp = NULL;
   Display *dpy = XtDisplay(w);
   Screen *screen = XtScreen(w);
   XContext local_context;
 
   _XmProcessLock();
-  if (context == (XContext)NULL) context = XUniqueContext();
+  if (context == (XContext)(uintptr_t)NULL) context = XUniqueContext();
 
   local_context = context;
   _XmProcessUnlock();
@@ -1745,7 +1745,7 @@
         }
         _XmTextSetCursorPosition(widget, cursorPos);
       } else if (start == tw->text.cursor_position && tw->text.auto_show_cursor_position) {
-        _XmTextShowPosition(tw, cursorPos);
+        _XmTextShowPosition((struct _WidgetRec *)tw, cursorPos);
       }
     }
 #else
@@ -3027,7 +3027,7 @@
   if (!tw->text.editable && editable) {
     OutputData o_data = tw->text.output->data;
     
-    XmImRegister(widget, (unsigned int) NULL);
+    XmImRegister(widget, (unsigned int)(uintptr_t) NULL);
     
     (*tw->text.output->PosToXY)(tw, tw->text.cursor_position,
 				&xmim_point.x, &xmim_point.y);
diff -Nurd -x'*~' motif-2.3.4.orig/lib/Xm/TextF.c motif-2.3.4/lib/Xm/TextF.c
--- motif-2.3.4.orig/lib/Xm/TextF.c	2012-10-22 10:50:34.000000000 -0400
+++ motif-2.3.4/lib/Xm/TextF.c	2015-11-18 00:10:47.000000000 -0500
@@ -116,7 +116,7 @@
         wchar_t *save = ws1;
 
         for (; *ws1; ++ws1);
-        while (*ws1++ = *ws2++);
+        while ((*ws1++ = *ws2++));
         return save;
 }
 #define wcscat(w1,w2) _Xmwcscat(w1,w2)
@@ -7361,7 +7361,7 @@
   XmTextFieldSetEditable((Widget)tf, TextF_Editable(tf));
   
   if (TextF_Editable(tf)) {
-    XmImRegister((Widget)tf, (unsigned int) NULL);
+    XmImRegister((Widget)tf, (unsigned int)(uintptr_t) NULL);
     GetXYFromPos(tf, TextF_CursorPosition(tf), &xmim_point.x, &xmim_point.y);
     (void)TextFieldGetDisplayRect((Widget)tf, &xmim_area);
     n = 0;
@@ -8233,7 +8233,7 @@
       diff_values = True;
       if (TextF_WcValue(new_tf) == NULL) {
 	TextF_WcValue(new_tf) = (wchar_t*) XtMalloc(sizeof(wchar_t));
-	*TextF_WcValue(new_tf) = (wchar_t)NULL;
+	*TextF_WcValue(new_tf) = (wchar_t)(uintptr_t)NULL;
       }
       ValidateString(new_tf, (char*)TextF_WcValue(new_tf), True);
     } else if (TextF_Value(new_tf) != TextF_Value(old_tf)) {
@@ -10146,7 +10146,7 @@
    * give the IM the relevent values. */
   
   if (!TextF_Editable(tf) && editable) { 
-    XmImRegister((Widget)tf, (unsigned int) NULL);
+    XmImRegister((Widget)tf, (unsigned int)(uintptr_t) NULL);
     
     GetXYFromPos(tf, TextF_CursorPosition(tf), &xmim_point.x, 
 		 &xmim_point.y);
diff -Nurd -x'*~' motif-2.3.4.orig/lib/Xm/TextFunc.c motif-2.3.4/lib/Xm/TextFunc.c
--- motif-2.3.4.orig/lib/Xm/TextFunc.c	2012-10-22 10:50:34.000000000 -0400
+++ motif-2.3.4/lib/Xm/TextFunc.c	2015-11-18 00:10:47.000000000 -0500
@@ -744,9 +744,9 @@
     _XmAppUnlock(app);
     return ret_val;
   } else {
-    Dimension *baselines;
+    Dimension *baselines = NULL;
     int temp_bl;
-    int line_count;
+    int line_count = 0;
     XmPrimitiveClassExt           *wcePtr;
     XmTextWidget tw = (XmTextWidget) widget;
 
@@ -775,9 +775,9 @@
 int 
 XmTextGetCenterline(Widget widget)
 {
-  Dimension *baselines;
+  Dimension *baselines = NULL;
   int temp_bl;
-  int line_count;
+  int line_count = 0;
   XmPrimitiveClassExt           *wcePtr;
   XmTextWidget tw = (XmTextWidget) widget;
 
diff -Nurd -x'*~' motif-2.3.4.orig/lib/Xm/TextIn.c motif-2.3.4/lib/Xm/TextIn.c
--- motif-2.3.4.orig/lib/Xm/TextIn.c	2012-10-22 10:50:37.000000000 -0400
+++ motif-2.3.4/lib/Xm/TextIn.c	2015-11-18 00:10:47.000000000 -0500
@@ -1683,7 +1683,7 @@
 	     String *params,
 	     Cardinal *num_params)
 {
-  XmTextPosition position, left, right, cursorPos;
+  XmTextPosition position = 0, left, right, cursorPos;
   XmTextWidget tw = (XmTextWidget) w;
   InputData data = tw->text.input->data;
   XmTextScanDirection  cursorDir;                              /* PIR1858 */
diff -Nurd -x'*~' motif-2.3.4.orig/lib/Xm/VendorS.c motif-2.3.4/lib/Xm/VendorS.c
--- motif-2.3.4.orig/lib/Xm/VendorS.c	2012-10-22 10:50:37.000000000 -0400
+++ motif-2.3.4/lib/Xm/VendorS.c	2015-11-18 00:10:47.000000000 -0500
@@ -1563,8 +1563,8 @@
         ttp->post_delay = 5000;
         ttp->post_duration = 5000;
         ttp->enable = False;
-        ttp->timer = (int) NULL;
-        ttp->duration_timer = (int) NULL;
+        ttp->timer = (int)(uintptr_t) NULL;
+        ttp->duration_timer = (int)(uintptr_t) NULL;
         ttp->leave_time = 0;
         ttp->slider = ttp->label = NULL;
  
diff -Nurd -x'*~' motif-2.3.4.orig/lib/Xm/XmExtUtil.c motif-2.3.4/lib/Xm/XmExtUtil.c
--- motif-2.3.4.orig/lib/Xm/XmExtUtil.c	2012-10-22 10:50:35.000000000 -0400
+++ motif-2.3.4/lib/Xm/XmExtUtil.c	2015-11-18 00:10:47.000000000 -0500
@@ -794,7 +794,8 @@
 	WidgetClass p = wc;
 
     _XmProcessLock();
-	for(; (p) && (p != sc); p = p->core_class.superclass);
+	for(; (p) && (p != sc); p = p->core_class.superclass)
+	;
     _XmProcessUnlock();
 
 	return (p == sc);
diff -Nurd -x'*~' motif-2.3.4.orig/lib/Xm/XmIm.c motif-2.3.4/lib/Xm/XmIm.c
--- motif-2.3.4.orig/lib/Xm/XmIm.c	2012-10-22 10:50:38.000000000 -0400
+++ motif-2.3.4/lib/Xm/XmIm.c	2015-11-18 00:10:47.000000000 -0500
@@ -2517,7 +2517,7 @@
   (void) add_ref(&xic_info->widget_refs, widget);
   
   /* Set the current XIC for this widget. */
-  if (xim_info->current_xics == (XContext) NULL)
+  if (xim_info->current_xics == (XContext)(uintptr_t) NULL)
     xim_info->current_xics = XUniqueContext();
   (void) XSaveContext(XtDisplay(widget), (XID) widget, 
 		      xim_info->current_xics, (XPointer) xic_info);
diff -Nurd -x'*~' motif-2.3.4.orig/lib/Xm/XmP.h motif-2.3.4/lib/Xm/XmP.h
--- motif-2.3.4.orig/lib/Xm/XmP.h	2012-10-22 10:50:35.000000000 -0400
+++ motif-2.3.4/lib/Xm/XmP.h	2015-11-18 00:10:47.000000000 -0500
@@ -1442,12 +1442,15 @@
 
 #endif /* NO_XM_1_2_BC */
 
-#if __GNUC__
+#ifdef __GNUC__
 #  define XM_DEPRECATED  __attribute__((__deprecated__))
-#  define XM_ALIAS(sym)  __attribute__((__weak__,alias(#sym)))
+#  ifndef __APPLE__
+#    define XM_ALIAS(sym)  __attribute__((__weak__,alias(#sym)))
+#  else
+#    define XM_ALIAS(sym)
+#  endif
 #else
 #  define XM_DEPRECATED
-#  define XM_ALIAS(sym)
 #endif
 
 #define FIX_1381
diff -Nurd -x'*~' motif-2.3.4.orig/lib/Xm/XmString.c motif-2.3.4/lib/Xm/XmString.c
--- motif-2.3.4.orig/lib/Xm/XmString.c	2012-10-22 10:50:35.000000000 -0400
+++ motif-2.3.4/lib/Xm/XmString.c	2015-11-18 00:10:47.000000000 -0500
@@ -7181,7 +7181,7 @@
   int ret_val;
 
   _XmProcessLock();
-  if ((string == NULL)) {
+  if (string == NULL) {
 	_XmProcessUnlock();
 	return(0);
   }
diff -Nurd -x'*~' motif-2.3.4.orig/lib/Xm/XpmI.h motif-2.3.4/lib/Xm/XpmI.h
--- motif-2.3.4.orig/lib/Xm/XpmI.h	2012-10-22 10:50:34.000000000 -0400
+++ motif-2.3.4/lib/Xm/XpmI.h	2015-11-18 00:10:47.000000000 -0500
@@ -291,7 +291,7 @@
 FUNC(xpmHashIntern, int, (xpmHashTable *table, char *tag, void *data));
 
 #define HashAtomData(i) ((void *)i)
-#define HashColorIndex(slot) ((unsigned int)((*slot)->data))
+#define HashColorIndex(slot) ((unsigned int)(uintptr_t)((*slot)->data))
 #define USE_HASHTABLE (cpp > 2 && ncolors > 4)
 
 /* I/O utility */
diff -Nurd -x'*~' motif-2.3.4.orig/lib/Xm/Xpmparse.c motif-2.3.4/lib/Xm/Xpmparse.c
--- motif-2.3.4.orig/lib/Xm/Xpmparse.c	2012-10-22 10:50:34.000000000 -0400
+++ motif-2.3.4/lib/Xm/Xpmparse.c	2015-11-18 00:10:47.000000000 -0500
@@ -387,7 +387,7 @@
 	     */
 	    if (USE_HASHTABLE) {
 		ErrorStatus =
-		    xpmHashIntern(hashtable, color->string, HashAtomData(a));
+		    xpmHashIntern(hashtable, color->string, HashAtomData((uintptr_t)a));
 		if (ErrorStatus != XpmSuccess) {
 		    xpmFreeColorTable(colorTable, ncolors);
 		    return (ErrorStatus);
@@ -475,7 +475,7 @@
 	     */
 	    if (USE_HASHTABLE) {
 		ErrorStatus =
-		    xpmHashIntern(hashtable, color->string, HashAtomData(a));
+		    xpmHashIntern(hashtable, color->string, HashAtomData((uintptr_t)a));
 		if (ErrorStatus != XpmSuccess) {
 		    xpmFreeColorTable(colorTable, ncolors);
 		    return (ErrorStatus);
diff -Nurd -x'*~' motif-2.3.4.orig/lib/Xm/Xpms_popen.c motif-2.3.4/lib/Xm/Xpms_popen.c
--- motif-2.3.4.orig/lib/Xm/Xpms_popen.c	2012-10-22 10:50:35.000000000 -0400
+++ motif-2.3.4/lib/Xm/Xpms_popen.c	2015-11-18 00:10:47.000000000 -0500
@@ -56,7 +56,7 @@
   char *cmdcpy;
 
 
-  if(cmd == NULL || cmd == "")
+  if(cmd == NULL || strcmp(cmd,"") == 0)
     return(NULL);
 
   if(type[0] != 'r' && type[0] != 'w')
diff -Nurd -x'*~' motif-2.3.4.orig/tools/wml/Makefile.am motif-2.3.4/tools/wml/Makefile.am
--- motif-2.3.4.orig/tools/wml/Makefile.am	2012-10-22 10:50:39.000000000 -0400
+++ motif-2.3.4/tools/wml/Makefile.am	2015-11-18 10:05:01.000000000 -0500
@@ -26,16 +26,13 @@
 wmluiltok_SOURCES = wmluiltok.l
 wmluiltok_LDADD = @LEXLIB@
 
-wml_SOURCES = wml.c
-wml_LDADD = -L. -lwml
-wml_DEPENDENCIES = libwml.a
 
+wmldbcreate_SOURCES = wmldbcreate.c
 wmldbcreate_LDADD = ../../lib/Xm/libXm.la
 
 INCLUDES = -I../../lib -I$(srcdir)/../../lib -I$(srcdir)/../../include ${X_CFLAGS} 
 
-noinst_LIBRARIES = libwml.a
-libwml_a_SOURCES = wmlparse.y wml.c wmloutkey.c wmlouth.c wmloutmm.c wmloutp1.c wmlresolve.c wmlsynbld.c wmlutils.c
+wml_SOURCES = wmlparse.y wml.c wmloutkey.c wmlouth.c wmloutmm.c wmloutp1.c wmlresolve.c wmlsynbld.c wmlutils.c
 
 wmlparse.c: wmllex.c
 
@@ -43,7 +40,7 @@
 
 wmlsynbld.c: wmlparse.h
 
-$(srcdir)/wmldbcreate.c: $(WMLTARGETS) UilLexPars.h
+wmldbcreate.c: $(WMLTARGETS) UilLexPars.h
 
 UilLexPars.h: UilLexPars.c
 
@@ -66,7 +63,7 @@
 	./wmldbcreate -o motif.wmd
 
 clean-local:
-	$(RM) $(WMLTARGETS) $(WMDTABLE) $(REPORT) lex.yy.c libwml.a wml \
+	$(RM) $(WMLTARGETS) $(WMDTABLE) $(REPORT) lex.yy.c wml \
 	*.mm *.sdml *.txt wmlparse.c wmlparse.h wmluiltok wmllex.c \
 	tokens.dat DONE wmluiltok.c Uil.c Uil.h wml.report UilLexPars.[ch] ylwrap
  
diff -Nurd -x'*~' motif-2.3.4.orig/tools/wml/wmlouth.c motif-2.3.4/tools/wml/wmlouth.c
--- motif-2.3.4.orig/tools/wml/wmlouth.c	2012-10-22 10:50:39.000000000 -0400
+++ motif-2.3.4/tools/wml/wmlouth.c	2015-11-18 00:10:47.000000000 -0500
@@ -225,12 +225,12 @@
     printf ("\nCouldn't open UilSymGen.h");
     return;
     }
-fprintf (outfil, canned_warn);
+fprintf (outfil, "%s", canned_warn);
 
 /*
  * Write the sym_k..._object literals
  */
-fprintf (outfil, canned1);
+fprintf (outfil, "%s", canned1);
 for ( ndx=0 ; ndx<wml_obj_class_ptr->cnt ; ndx++ )
     {
     clsobj = (WmlClassDefPtr) wml_obj_class_ptr->hvec[ndx].objptr;
@@ -244,7 +244,7 @@
 /*
  * Define the sym_k_..._reason literals
  */
-fprintf (outfil, canned3);
+fprintf (outfil, "%s", canned3);
 for ( ndx=0 ; ndx<wml_obj_reason_ptr->cnt ; ndx++ )
     {
     resobj = (WmlResourceDefPtr) wml_obj_reason_ptr->hvec[ndx].objptr;
@@ -258,7 +258,7 @@
 /*
  * Define the sym_k_..._arg literals
  */
-fprintf (outfil, canned4);
+fprintf (outfil, "%s", canned4);
 for ( ndx=0 ; ndx<wml_obj_arg_ptr->cnt ; ndx++ )
     {
     resobj = (WmlResourceDefPtr) wml_obj_arg_ptr->hvec[ndx].objptr;
@@ -272,7 +272,7 @@
 /*
  * Define the sym_k_..._enumset structs and literals
  */
-fprintf (outfil, canned5);
+fprintf (outfil, "%s", canned5);
 for ( ndx=0 ; ndx<wml_obj_enumset_ptr->cnt ; ndx++ )
     {
     enumsetobj = (WmlEnumSetDefPtr) wml_obj_enumset_ptr->hvec[ndx].objptr;
@@ -286,7 +286,7 @@
 /*
  * Define the sym_k_..._enumval literals
  */
-fprintf (outfil, canned6);
+fprintf (outfil, "%s", canned6);
 for ( ndx=0 ; ndx<wml_obj_enumval_ptr->cnt ; ndx++ )
     {
     enumvalobj = (WmlEnumValueDefPtr) wml_obj_enumval_ptr->hvec[ndx].objptr;
@@ -301,7 +301,7 @@
  * Define the sym_k_..._charsize literals
  * Define the sym_k_..._charset literals
  */
-fprintf (outfil, canned7);
+fprintf (outfil, "%s", canned7);
 for ( ndx=0 ; ndx<wml_obj_charset_ptr->cnt ; ndx++ )
     {
     charsetobj = (WmlCharSetDefPtr) wml_obj_charset_ptr->hvec[ndx].objptr;
@@ -315,7 +315,7 @@
 /*
  * Define the sym_k_..._child literals
  */
-fprintf (outfil, canned8);
+fprintf (outfil, "%s", canned8);
 for ( ndx=0 ; ndx<wml_obj_child_ptr->cnt ; ndx++ )
     {
     childobj = (WmlChildDefPtr) wml_obj_child_ptr->hvec[ndx].objptr;
@@ -379,12 +379,12 @@
     printf ("\nCouldn't open UilSymChCL.h");
     return;
     }
-fprintf (outfil, canned_warn);
+fprintf (outfil, "%s", canned_warn);
 
 /*
  * Create table entries, similar to writing sym_k...
  */
-fprintf (outfil, canned1);
+fprintf (outfil, "%s", canned1);
 for ( ndx=0 ; ndx<wml_obj_child_ptr->cnt ; ndx++ )
     {
     childobj = (WmlChildDefPtr) wml_obj_child_ptr->hvec[ndx].objptr;
@@ -392,7 +392,7 @@
     fprintf (outfil, "    sym_k_%s_object,\n",
 	     classobj->tkname);
     }
-fprintf (outfil, canned1a);
+fprintf (outfil, "%s", canned1a);
 
 /*
  * close the output file
@@ -446,12 +446,12 @@
     printf ("\nCouldn't open UilSymArTy.h");
     return;
     }
-fprintf (outfil, canned_warn);
+fprintf (outfil, "%s", canned_warn);
 
 /*
  * Create table entries, similar to writing sym_k...
  */
-fprintf (outfil, canned1);
+fprintf (outfil, "%s", canned1);
 for ( ndx=0 ; ndx<wml_obj_arg_ptr->cnt ; ndx++ )
     {
     resobj = (WmlResourceDefPtr) wml_obj_arg_ptr->hvec[ndx].objptr;
@@ -459,7 +459,7 @@
     fprintf (outfil, "    sym_k_%s_value,\n",
 	     datobj->tkname);
     }
-fprintf (outfil, canned1a);
+fprintf (outfil, "%s", canned1a);
 
 /*
  * close the output file
@@ -509,19 +509,19 @@
     printf ("\nCouldn't open UilSymRArg.h");
     return;
     }
-fprintf (outfil, canned_warn);
+fprintf (outfil, "%s", canned_warn);
 
 /*
  * Create table entries, similar to writing sym_k...
  */
-fprintf (outfil, canned1);
+fprintf (outfil, "%s", canned1);
 for ( ndx=0 ; ndx<wml_obj_arg_ptr->cnt ; ndx++ )
     {
     resobj = (WmlResourceDefPtr) wml_obj_arg_ptr->hvec[ndx].objptr;
     fprintf (outfil, "    %d,\n",
 	     resobj->related_code);
     }
-fprintf (outfil, canned1a);
+fprintf (outfil, "%s", canned1a);
 
 /*
  * close the output file
@@ -621,12 +621,12 @@
     printf ("\nCouldn't open UilUrmClas.h");
     return;
     }
-fprintf (outfil, canned_warn);
+fprintf (outfil, "%s", canned_warn);
 
 /*
  * Write entries for widgets
  */
-fprintf (outfil, canned1);
+fprintf (outfil, "%s", canned1);
 for ( ndx=0 ; ndx<wml_obj_class_ptr->cnt ; ndx++ )
     {
     clsobj = (WmlClassDefPtr) wml_obj_class_ptr->hvec[ndx].objptr;
@@ -637,7 +637,7 @@
     else 
 	fprintf (outfil, "  \"%s\",\t\n", synobj->convfunc);
     }
-fprintf (outfil, canned2);
+fprintf (outfil, "%s", canned2);
 
 /*
  * Write entries for gadget variants of widget classes
@@ -661,7 +661,7 @@
 		     synobj->name);
 	}
     }
-fprintf (outfil, canned3);
+fprintf (outfil, "%s", canned3);
 
 /*
  * Write entries for non-dialog widgets
@@ -685,7 +685,7 @@
 		     synobj->name);
 	}
     }
-fprintf (outfil, canned4);
+fprintf (outfil, "%s", canned4);
 
 /*
  * Write entries for the resource a widget's controls map to
@@ -701,7 +701,7 @@
     else
 	fprintf (outfil, "  sym_k_%s_arg,\n", mapresobj->tkname);
     }
-fprintf (outfil, canned5);
+fprintf (outfil, "%s", canned5);
 
 /*
  * Write entries for arguments
@@ -714,7 +714,7 @@
     fprintf (outfil, "  %s,\n",
 	     synres->resliteral);
     }
-fprintf (outfil, canned6);
+fprintf (outfil, "%s", canned6);
 
 /*
  * Write entries for reasons
@@ -727,7 +727,7 @@
     fprintf (outfil, "  %s,\n",
 	     synres->resliteral);
     }
-fprintf (outfil, canned7);
+fprintf (outfil, "%s", canned7);
 
 /*
  * close the output file
@@ -781,13 +781,13 @@
     printf ("\nCouldn't open UilConst.h");
     return;
     }
-fprintf (outfil, canned_warn);
+fprintf (outfil, "%s", canned_warn);
 
 /*
  * Process the arguments in code order. We start with 1, and write out
  * the mask after processing 8 codes.
  */
-fprintf (outfil, canned1);
+fprintf (outfil, "%s", canned1);
 strcpy (maskbuf, "0");
 for ( ndx=0 ; ndx<wml_obj_arg_ptr->cnt ; ndx++ )
     {
@@ -805,7 +805,7 @@
     }
 if ( bitno != 8 )
     fprintf (outfil, "%s", maskbuf);
-fprintf (outfil, canned1a);
+fprintf (outfil, "%s", canned1a);
 
 /*
  * close the output file
@@ -878,8 +878,8 @@
     printf ("\nCouldn't open UilSymReas.h");
     return;
     }
-fprintf (outfil, canned_warn);
-fprintf (outfil, canned1);
+fprintf (outfil, "%s", canned_warn);
+fprintf (outfil, "%s", canned1);
 
 /*
  * Generate the bit vectors for each class. Outer loop on the reason code,
@@ -925,13 +925,13 @@
 /*
  * Write the vector of vectors.
  */
-fprintf (outfil, canned2);
+fprintf (outfil, "%s", canned2);
 for ( resndx=0 ; resndx<wml_obj_reason_ptr->cnt ; resndx++ )
     {
     resobj = (WmlResourceDefPtr) wml_obj_reason_ptr->hvec[resndx].objptr;
     fprintf (outfil, "  reason_class_vec%d,\n", resobj->sym_code);
     }
-fprintf (outfil, canned3);
+fprintf (outfil, "%s", canned3);
 
 /*
  * close the output file
@@ -1004,8 +1004,8 @@
     printf ("\nCouldn't open UilSymArTa.h");
     return;
     }
-fprintf (outfil, canned_warn);
-fprintf (outfil, canned1);
+fprintf (outfil, "%s", canned_warn);
+fprintf (outfil, "%s", canned1);
 
 /*
  * Generate the bit vectors for each class. Outer loop on the argument code,
@@ -1051,13 +1051,13 @@
 /*
  * Write the vector of vectors.
  */
-fprintf (outfil, canned2);
+fprintf (outfil, "%s", canned2);
 for ( resndx=0 ; resndx<wml_obj_arg_ptr->cnt ; resndx++ )
     {
     resobj = (WmlResourceDefPtr) wml_obj_arg_ptr->hvec[resndx].objptr;
     fprintf (outfil, "  arg_class_vec%d,\n", resobj->sym_code);
     }
-fprintf (outfil, canned3);
+fprintf (outfil, "%s", canned3);
 
 /*
  * close the output file
@@ -1129,8 +1129,8 @@
     printf ("\nCouldn't open UilSymChTa.h");
     return;
     }
-fprintf (outfil, canned_warn);
-fprintf (outfil, canned1);
+fprintf (outfil, "%s", canned_warn);
+fprintf (outfil, "%s", canned1);
 
 /*
  * Generate the bit vectors for each class. Outer loop on the child code,
@@ -1174,13 +1174,13 @@
 /*
  * Write the vector of vectors.
  */
-fprintf (outfil, canned2);
+fprintf (outfil, "%s", canned2);
 for ( childndx=0 ; childndx<wml_obj_child_ptr->cnt ; childndx++ )
     {
     childobj = (WmlChildDefPtr) wml_obj_child_ptr->hvec[childndx].objptr;
     fprintf (outfil, "  child_class_vec%d,\n", childobj->sym_code);
     }
-fprintf (outfil, canned3);
+fprintf (outfil, "%s", canned3);
 
 /*
  * close the output file
@@ -1251,8 +1251,8 @@
     printf ("\nCouldn't open UilSymCtl.h");
     return;
     }
-fprintf (outfil, canned_warn);
-fprintf (outfil, canned1);
+fprintf (outfil, "%s", canned_warn);
+fprintf (outfil, "%s", canned1);
 
 /*
  * Generate the bit vectors for each class. Outer loop on the class code,
@@ -1296,13 +1296,13 @@
 /*
  * Write the vector of vectors.
  */
-fprintf (outfil, canned2);
+fprintf (outfil, "%s", canned2);
 for ( ctlndx=0 ; ctlndx<wml_obj_class_ptr->cnt ; ctlndx++ )
     {
     clsobj = (WmlClassDefPtr) wml_obj_class_ptr->hvec[ctlndx].objptr;
     fprintf (outfil, "  object_class_vec%d,\n", clsobj->sym_code);
     }
-fprintf (outfil, canned3);
+fprintf (outfil, "%s", canned3);
 
 /*
  * close the output file
@@ -1438,7 +1438,7 @@
     printf ("\nCouldn't open UilSymNam.h");
     return;
     }
-fprintf (outfil, canned_warn);
+fprintf (outfil, "%s", canned_warn);
 
 /*
  * Write entries for widgets
@@ -1517,7 +1517,7 @@
     fprintf (outfil, "    \"%s\",\n",
 	     synch->name);
     }
-fprintf (outfil, canned7);
+fprintf (outfil, "%s", canned7);
 
 /*
  * close the output file
@@ -1621,12 +1621,12 @@
     printf ("\nCouldn't open UilSymEnum.h");
     return;
     }
-fprintf (outfil, canned_warn);
+fprintf (outfil, "%s", canned_warn);
 
 /*
  * Generate the enumeration value vectors for each enumeration set.
  */
-fprintf (outfil, canned1);
+fprintf (outfil, "%s", canned1);
 for ( ndx=0 ; ndx<wml_obj_enumset_ptr->cnt ; ndx++ )
     {
     enumsetobj = (WmlEnumSetDefPtr) wml_obj_enumset_ptr->hvec[ndx].objptr;
@@ -1643,7 +1643,7 @@
 /*
  * Generate the enumeration set tables
  */
-fprintf (outfil, canned3);
+fprintf (outfil, "%s", canned3);
 for ( ndx=0 ; ndx<wml_obj_enumset_ptr->cnt ; ndx++ )
     {
     enumsetobj = (WmlEnumSetDefPtr) wml_obj_enumset_ptr->hvec[ndx].objptr;
@@ -1655,7 +1655,7 @@
 /*
  * Create enumset table entries for arguments, similar to writing sym_k...
  */
-fprintf (outfil, canned4);
+fprintf (outfil, "%s", canned4);
 for ( ndx=0 ; ndx<wml_obj_arg_ptr->cnt ; ndx++ )
     {
     resobj = (WmlResourceDefPtr) wml_obj_arg_ptr->hvec[ndx].objptr;
@@ -1669,13 +1669,13 @@
 /*
  * Create the enumval values table.
  */
-fprintf (outfil, canned5);
+fprintf (outfil, "%s", canned5);
 for ( ndx=0 ; ndx<wml_obj_enumval_ptr->cnt ; ndx++ )
     {
     evobj = (WmlEnumValueDefPtr) wml_obj_enumval_ptr->hvec[ndx].objptr;
     fprintf (outfil, "  %s,\n", evobj->syndef->enumlit);
     }
-fprintf (outfil, canned5a);
+fprintf (outfil, "%s", canned5a);
 
 /*
  * close the output file
@@ -1813,12 +1813,12 @@
     printf ("\nCouldn't open UilSymCSet.h");
     return;
     }
-fprintf (outfil, canned_warn);
+fprintf (outfil, "%s", canned_warn);
 
 /*
  * Generate the standards name table
  */
-fprintf (outfil, canned1);
+fprintf (outfil, "%s", canned1);
 for ( ndx=0 ; ndx<wml_obj_charset_ptr->cnt ; ndx++ )
     {
     csobj = (WmlCharSetDefPtr) wml_obj_charset_ptr->hvec[ndx].objptr;
@@ -1836,7 +1836,7 @@
 /*
  * Generate the writing direction table
  */
-fprintf (outfil, canned2);
+fprintf (outfil, "%s", canned2);
 for ( ndx=0 ; ndx<wml_obj_charset_ptr->cnt ; ndx++ )
     {
     csobj = (WmlCharSetDefPtr) wml_obj_charset_ptr->hvec[ndx].objptr;
@@ -1858,7 +1858,7 @@
 /*
  * Generate the parsing direction table
  */
-fprintf (outfil, canned3);
+fprintf (outfil, "%s", canned3);
 for ( ndx=0 ; ndx<wml_obj_charset_ptr->cnt ; ndx++ )
     {
     csobj = (WmlCharSetDefPtr) wml_obj_charset_ptr->hvec[ndx].objptr;
@@ -1880,7 +1880,7 @@
 /*
  * Generate the character size table
  */
-fprintf (outfil, canned4);
+fprintf (outfil, "%s", canned4);
 for ( ndx=0 ; ndx<wml_obj_charset_ptr->cnt ; ndx++ )
     {
     csobj = (WmlCharSetDefPtr) wml_obj_charset_ptr->hvec[ndx].objptr;
@@ -1906,7 +1906,7 @@
 /*
  * Generate the $LANG name recognition table
  */
-fprintf (outfil, canned5);
+fprintf (outfil, "%s", canned5);
 lang_max = 0;
 for ( ndx=0 ; ndx<wml_obj_charset_ptr->cnt ; ndx++ )
     {
@@ -1936,7 +1936,7 @@
 /*
  * Generate the $LANG code lookup table, in upper case
  */
-fprintf (outfil, canned6);
+fprintf (outfil, "%s", canned6);
 for ( ndx=0 ; ndx<wml_obj_charset_ptr->cnt ; ndx++ )
     {
     csobj = (WmlCharSetDefPtr) wml_obj_charset_ptr->hvec[ndx].objptr;
diff -Nurd -x'*~' motif-2.3.4.orig/tools/wml/wmloutkey.c motif-2.3.4/tools/wml/wmloutkey.c
--- motif-2.3.4.orig/tools/wml/wmloutkey.c	2012-10-22 10:50:39.000000000 -0400
+++ motif-2.3.4/tools/wml/wmloutkey.c	2015-11-18 00:10:47.000000000 -0500
@@ -574,16 +574,16 @@
     printf ("\nCouldn't open UilKeyTab.h");
     return;
     }
-fprintf (outfil, canned_warn);
+fprintf (outfil, "%s", canned_warn);
 
 /*
  * Print the case sensitive and insensitive tables
  */
-fprintf (outfil, canned1);
+fprintf (outfil, "%s", canned1);
 wmlOutputUilKeyTabBody (outfil, wml_tok_sens_ptr, &maxlen, &maxkey);
 fprintf (outfil, canned2, maxlen, maxkey);
 wmlOutputUilKeyTabBody (outfil, wml_tok_insens_ptr, &maxlen, &maxkey);
-fprintf (outfil, canned3);
+fprintf (outfil, "%s", canned3);
 
 /*
  * close the output file
@@ -812,8 +812,8 @@
     printf ("\nCouldn't open UilTokName.h");
     return;
     }
-fprintf (outfil, canned_warn);
-fprintf (outfil, canned1);
+fprintf (outfil, "%s", canned_warn);
+fprintf (outfil, "%s", canned1);
 
 /*
  * Print the token name entries
diff -Nurd -x'*~' motif-2.3.4.orig/tools/wml/wmloutmm.c motif-2.3.4/tools/wml/wmloutmm.c
--- motif-2.3.4.orig/tools/wml/wmloutmm.c	2012-10-22 10:50:39.000000000 -0400
+++ motif-2.3.4/tools/wml/wmloutmm.c	2015-11-18 00:10:47.000000000 -0500
@@ -209,9 +209,9 @@
 /*
  * Write out header information
  */
-fprintf (outfil, canned1);
+fprintf (outfil, "%s", canned1);
 fprintf (outfil, "%s\n", name);
-fprintf (outfil, canned2);
+fprintf (outfil, "%s", canned2);
 
 /*
  * Alphabetize the controls, reason, and argument lists
@@ -287,7 +287,7 @@
     else
 	fprintf (outfil, "\n");
     }
-fprintf (outfil, canned3);
+fprintf (outfil, "%s", canned3);
 
 /*
  * Write out the argument table
@@ -323,7 +323,7 @@
     }    
     argndx += 1;
     }
-fprintf (outfil, canned4);
+fprintf (outfil, "%s", canned4);
 
 }
 
