574c35
--- ./src/sysfiles.h.orig	2008-09-02 10:50:38.000000000 -0600
574c35
+++ ./src/sysfiles.h	2011-08-04 13:57:32.717487674 -0600
574c35
@@ -46,7 +46,7 @@
574c35
 extern Int SyFindOrLinkGapRootFile (
574c35
             Char *          filename,
574c35
             Int4            crc_gap,
574c35
-            Char *          result,
574c35
+            union StringOrInitInfo * result,
574c35
             Int             len );
574c35
 
574c35
 
574c35
--- ./src/sysfiles.c.orig	2008-12-14 14:25:54.000000000 -0700
574c35
+++ ./src/sysfiles.c	2011-08-04 14:07:06.846239128 -0600
574c35
@@ -191,7 +191,7 @@
574c35
 Int SyFindOrLinkGapRootFile (
574c35
     Char *              filename,
574c35
     Int4                crc_gap,
574c35
-    Char *              result, 
574c35
+    union StringOrInitInfo * result, 
574c35
     Int                 len )
574c35
 {
574c35
     UInt4               crc_dyn = 0;
574c35
@@ -215,19 +215,19 @@
574c35
 #endif
574c35
 
574c35
     /* find the GAP file                                                   */
574c35
-    result[0] = '\0';
574c35
+    result->string[0] = '\0';
574c35
     tmp = SyFindGapRootFile(filename);
574c35
     if ( tmp ) {
574c35
-        SyStrncat( result, tmp, len );
574c35
+        SyStrncat( result->string, tmp, len );
574c35
         name[0] = '\0';
574c35
         SyStrncat( name, tmp, 255 );
574c35
     }
574c35
-    if ( result[0] ) {
574c35
-        if ( SyIsReadableFile(result) == 0 ) {
574c35
+    if ( result->string[0] ) {
574c35
+        if ( SyIsReadableFile(result->string) == 0 ) {
574c35
             found_gap = 1;
574c35
         }
574c35
         else {
574c35
-            result[0] = '\0';
574c35
+            result->string[0] = '\0';
574c35
         }
574c35
     }
574c35
     if ( ! SyUseModule ) {
574c35
@@ -389,11 +389,11 @@
574c35
 		if (found_dyn)
574c35
 			syUnloadLastModule ();
574c35
 #endif        
574c35
-        *(StructInitInfo**)result = info_sta;
574c35
+        result->info = info_sta;
574c35
         return 2;
574c35
     }
574c35
     if ( found_gap && found_dyn ) {
574c35
-        *(StructInitInfo**)result = info_dyn;
574c35
+        result->info = info_dyn;
574c35
         return 1;
574c35
     }
574c35
     if ( found_gap ) {
574c35
@@ -404,11 +404,11 @@
574c35
 		if (found_dyn)
574c35
 			syUnloadLastModule ();
574c35
 #endif        
574c35
-        *(StructInitInfo**)result = info_sta;
574c35
+        result->info = info_sta;
574c35
         return 2;
574c35
     }
574c35
     if ( found_dyn ) {
574c35
-        *(StructInitInfo**)result = info_dyn;
574c35
+        result->info = info_dyn;
574c35
         return 1;
574c35
     }
574c35
     return 0;
574c35
--- ./src/gap.c.orig	2007-10-04 09:05:16.000000000 -0600
574c35
+++ ./src/gap.c	2011-08-04 14:09:27.815182164 -0600
574c35
@@ -1650,7 +1650,7 @@
574c35
     StructInitInfo *    info;
574c35
     Int4                crc1;
574c35
     Int4                crc2;
574c35
-    Char                result[256];
574c35
+    union StringOrInitInfo result;
574c35
     Int                 res;
574c35
 
574c35
 
574c35
@@ -1670,7 +1670,7 @@
574c35
 
574c35
     /* check if have a statically or dynamically loadable module           */
574c35
     crc1 = INT_INTOBJ(crc);
574c35
-    res  = SyFindOrLinkGapRootFile(CSTR_STRING(filename), crc1, result, 256);
574c35
+    res  = SyFindOrLinkGapRootFile(CSTR_STRING(filename), crc1, &result, 256);
574c35
 
574c35
     /* not found                                                           */
574c35
     if ( res == 0 ) {
574c35
@@ -1685,7 +1685,7 @@
574c35
             Pr( "#I  READ_GAP_ROOT: loading '%s' dynamically\n",
574c35
                 (Int)CSTR_STRING(filename), 0L );
574c35
         }
574c35
-        info = *(StructInitInfo**)result;
574c35
+        info = result.info;
574c35
         res  = info->initKernel(info);
574c35
 	UpdateCopyFopyInfo();
574c35
         res  = res || info->initLibrary(info);
574c35
@@ -1703,7 +1703,7 @@
574c35
             Pr( "#I  READ_GAP_ROOT: loading '%s' statically\n",
574c35
                 (Int)CSTR_STRING(filename), 0L );
574c35
         }
574c35
-        info = *(StructInitInfo**)result;
574c35
+        info = result.info;
574c35
         res  = info->initKernel(info);
574c35
 	UpdateCopyFopyInfo();
574c35
         res  = res || info->initLibrary(info);
574c35
@@ -1721,15 +1721,15 @@
574c35
 
574c35
         /* compute the crc value of the original and compare               */
574c35
         if ( SyCheckCompletionCrcComp ) {
574c35
-            crc2 = SyGAPCRC(result);
574c35
+            crc2 = SyGAPCRC(result.string);
574c35
             if ( crc1 != crc2 ) {
574c35
                 return INTOBJ_INT(4);
574c35
             }
574c35
         }
574c35
-        /*CCC filename = NEW_STRING( SyStrlen(result) );
574c35
+        /*CCC filename = NEW_STRING( SyStrlen(result.string) );
574c35
 	  SyStrncat( CSTR_STRING(filename), result, SyStrlen(result) );CCC*/
574c35
-	len = SyStrlen(result);
574c35
-	C_NEW_STRING(filename, len, result);
574c35
+	len = SyStrlen(result.string);
574c35
+	C_NEW_STRING(filename, len, result.string);
574c35
 
574c35
         CompThenFuncs = NEW_PLIST( T_PLIST, COMP_THEN_OFFSET );
574c35
         SET_LEN_PLIST( CompThenFuncs, COMP_THEN_OFFSET );
574c35
--- ./src/system.h.orig	2007-10-06 16:53:20.000000000 -0600
574c35
+++ ./src/system.h	2011-08-04 14:04:52.971092306 -0600
574c35
@@ -1105,6 +1105,10 @@
574c35
 
574c35
 typedef StructInitInfo* (*InitInfoFunc)(void);
574c35
 
574c35
+union StringOrInitInfo {
574c35
+    Char string[256];
574c35
+    StructInitInfo * info;
574c35
+};
574c35
 
574c35
 /****************************************************************************
574c35
 **
574c35
--- ./src/saveload.c.orig	2002-06-16 06:37:20.000000000 -0600
574c35
+++ ./src/saveload.c	2011-08-04 13:41:46.547763965 -0600
574c35
@@ -37,6 +37,11 @@
574c35
 #include        "saveload.h"            /* saving and loading              */
574c35
 #undef  INCLUDE_DECLARATION_PART
574c35
 
574c35
+union double_bytes {
574c35
+  Double d;
574c35
+  UInt1 bytes[sizeof(Double)];
574c35
+};
574c35
+
574c35
 
574c35
 /***************************************************************************
574c35
 **
574c35
@@ -438,19 +443,19 @@
574c35
 void SaveDouble( Double d)
574c35
 {
574c35
   UInt i;
574c35
-  UInt1 buf[sizeof(Double)];
574c35
-  *(Double *)buf = d;
574c35
+  union double_bytes buf;
574c35
+  buf.d = d;
574c35
   for (i = 0; i < sizeof(Double); i++)
574c35
-    SAVE_BYTE(buf[i]);
574c35
+    SAVE_BYTE(buf.bytes[i]);
574c35
 }
574c35
 
574c35
 Double LoadDouble( void)
574c35
 {
574c35
   UInt i;
574c35
-  UInt1 buf[sizeof(Double)];
574c35
+  union double_bytes buf;
574c35
   for (i = 0; i < sizeof(Double); i++)
574c35
-    buf[i] = LOAD_BYTE();
574c35
-  return *(Double *)buf;
574c35
+    buf.bytes[i] = LOAD_BYTE();
574c35
+  return buf.d;
574c35
 }
574c35
 
574c35
 /***************************************************************************
574c35
--- ./src/streams.c.orig	2008-09-02 10:52:34.000000000 -0600
574c35
+++ ./src/streams.c	2011-08-04 14:10:55.735229846 -0600
574c35
@@ -316,13 +316,13 @@
574c35
 
574c35
 Int READ_GAP_ROOT ( Char * filename )
574c35
 {
574c35
-    Char                result[256];
574c35
+    union StringOrInitInfo result;
574c35
     Int                 res;
574c35
     UInt                type;
574c35
     StructInitInfo *    info;
574c35
 
574c35
     /* try to find the file                                                */
574c35
-    res = SyFindOrLinkGapRootFile( filename, 0L, result, 256 );
574c35
+    res = SyFindOrLinkGapRootFile( filename, 0L, &result, 256 );
574c35
 
574c35
     /* not found                                                           */
574c35
     if ( res == 0 ) {
574c35
@@ -335,7 +335,7 @@
574c35
             Pr( "#I  READ_GAP_ROOT: loading '%s' dynamically\n",
574c35
                 (Int)filename, 0L );
574c35
         }
574c35
-        info = *(StructInitInfo**)result;
574c35
+        info = result.info;
574c35
 	res  = info->initKernel(info);
574c35
 	if (!SyRestoring) {
574c35
 	  UpdateCopyFopyInfo();
574c35
@@ -356,7 +356,7 @@
574c35
             Pr( "#I  READ_GAP_ROOT: loading '%s' statically\n",
574c35
                 (Int)filename, 0L );
574c35
         }
574c35
-        info = *(StructInitInfo**)result;
574c35
+        info = result.info;
574c35
 	res  = info->initKernel(info);
574c35
 	if (!SyRestoring) {
574c35
 	  UpdateCopyFopyInfo();
574c35
@@ -388,7 +388,7 @@
574c35
             Pr( "#I  READ_GAP_ROOT: loading '%s' as GAP file\n",
574c35
                 (Int)filename, 0L );
574c35
         }
574c35
-        if ( OpenInput(result) ) {
574c35
+        if ( OpenInput(result.string) ) {
574c35
 	  SySetBuffering(Input->file);
574c35
             while ( 1 ) {
574c35
                 ClearError();