[svn-commits] /ingres r3146 - in main/src/cl/clf: hdr si_unix

ingres at ingres.com ingres at ingres.com
Tue Jun 15 03:45:11 PDT 2010


Author: ingres
Date: 2010-06-15 03:45:11 -0700 (Tue, 15 Jun 2010)
New Revision: 3146

Modified:
   main/src/cl/clf/hdr/clsigs.h
   main/src/cl/clf/si_unix/siprintf.c
Log:
Fix "deprecated routine" warnings and build problems
on Mac OSX.  In particular, CMcpychar was being used
with a constant string, which fails when the constant
is compiled into the very end of the __const section.



Modified: main/src/cl/clf/hdr/clsigs.h
===================================================================
--- main/src/cl/clf/hdr/clsigs.h	2010-06-15 08:00:27 UTC (rev 3145)
+++ main/src/cl/clf/hdr/clsigs.h	2010-06-15 10:45:11 UTC (rev 3146)
@@ -88,6 +88,9 @@
 **	    Replace mg5_osx with generic OSX
 **	22-Jun-2009 (kschendel) SIR 122138
 **	    Use any_aix, sparc_sol, any_hpux symbols as needed.
+**	4-Jun-2010 (kschendel)
+**	    OSX wants sys/ucontext.h, ucontext.h spews warnings about
+**	    deprecated routines.
 */
 # ifndef CLCONFIG_H_INCLUDED
         # error "didn't include clconfig.h before clsigs.h"
@@ -125,7 +128,11 @@
 # include <signal.h>
 # include <sys/regset.h>
 # endif /* sos_us5 */
+#ifdef OSX
+# include <sys/ucontext.h>
+#else
 # include <ucontext.h>
+#endif
 # endif /* xCL_071_UCONTEXT_H_EXISTS */
 
 

Modified: main/src/cl/clf/si_unix/siprintf.c
===================================================================
--- main/src/cl/clf/si_unix/siprintf.c	2010-06-15 08:00:27 UTC (rev 3145)
+++ main/src/cl/clf/si_unix/siprintf.c	2010-06-15 10:45:11 UTC (rev 3146)
@@ -127,6 +127,11 @@
 **     12-Apr-2010 (maspa05) bug 123560
 **          SIdofrmt unable to handle long strings (such as those passed by
 **          SC930) because realwidth was an i2. Make it an i4.
+**	4-Jun-2010 (kschendel)
+**	    Fix constant CMcpychar's to be *ptr++ = c instead.  Otherwise,
+**	    the double-byte macro might refer past the end of a constant, and
+**	    indeed past the end of an object section, causing "local relocation
+**	    in section __text does not target section __const" on MacOS x86_64.
 */
 
 # define	LEFTADJUST	0x01
@@ -511,10 +516,7 @@
 			                    if ( putfunc == PUTC )
 						 SIputc(c, outfile);
 			                    else
-			                    {
-				                CMcpychar((uchar *) &c, outchar);
-                                                CMnext(outchar);
-			                    }
+						*outchar++ = c;
 					} while (realwidth < --width);
 				}
 
@@ -558,10 +560,7 @@
 			            if ( putfunc == PUTC )
 					SIputc(' ', outfile);
 			            else
-			            {
-				        CMcpychar((uchar *) " ", outchar);
-                                        CMnext(outchar);
-			            }
+					*outchar++ = ' ';
 				}
 			}
 
@@ -571,7 +570,7 @@
 		if (*p == EOS)
 			break;
 	}	/* end for */
-	if( putfunc != PUTC )	
-	    CMcpychar((uchar *) "\0", outchar);
+	if( putfunc != PUTC )
+	    *outchar = '\0';
 }
 



More information about the svn-commits mailing list