[HACKERS] [PATCHES] fixes for sparc-solaris (fwd)

Поиск
Список
Период
Сортировка
Искать

[HACKERS] [PATCHES] fixes for sparc-solaris (fwd)

От:
Bruce Momjian <maillist@candle.pha.pa.us>
Дата:
Any comments on applying this?  It looks good to me.

Forwarded message:
> From owner-pgsql-patches@hub.org Fri Jun 20 13:30:38 1997
> Date: Fri, 20 Jun 1997 13:07:36 -0400
> From: axafbin@pelf.harvard.edu (Common AXAF Software)
> Message-Id: <199706201707.NAA03377@pelf>
> To: pgsql-patches@postgreSQL.org
> Subject: [PATCHES] fixes for sparc-solaris
> Cc: dj@pelf.harvard.edu
> Sender: owner-pgsql-patches@hub.org
> Precedence: bulk
> 
> ============================================================================
>                         POSTGRESQL BUG REPORT TEMPLATE
> ============================================================================
> 
> 
> Your name		: Diab Jerius
> Your email address	: djerius@cfa.harvard.edu
> 
> 
> System Configuration
> ---------------------
>   Architecture (example: Intel Pentium)  	: Sparc
> 
>   Operating System (example: Linux 2.0.26 ELF) 	: Solaris 2.5.1
> 
>   PostgreSQL version (example: PostgreSQL-6.1)  : PostgreSQL-6.1
> 
>   Compiler used (example:  gcc 2.7.2)		: SunOS cc 4.0.1
> 
> 
> Please enter a FULL description of your problem:
> ------------------------------------------------
> 
> Various compile errors concerning overflow due to shifts (<<) and 
> masking of chars with constants.  The first set of errors is due to
> the compiler holding the result in a signed int ( e.g. 15 << 27 is
> too big for a signed int, bug fits just fine in an unsigned one)
> while the destination was unsigned.
> 
> The second was caused by masking a signed char with a number greater
> than 127; this caused a warning about the result not fitting.
> 
> There were various spots where old K&R type prototypes were present
> and overrode true prototypes specified elsewhere.
> 
> the sparc_solaris-cc file should have more strict ANSI flags.
> 
> There are patches below which fix the above problems.
> 
> ----------------------------------------------------------------------
> 
> 
> 
> 
> 
> If you know how this problem might be fixed, list the solution below:
> ---------------------------------------------------------------------
> 
> 
> Index: src/backend/catalog/pg_aggregate.c
> Prereq:  1.4 
> *** postgresql-v6.1/src/backend/catalog/pg_aggregate.c	Fri Nov  8 00:00:25 1996
> --- postgresql-v6.1-cc-fix/src/backend/catalog/pg_aggregate.c	Thu Jun 19 16:31:24 1997
> ***************
> *** 269,275 ****
>       Oid	transtype;
>       text	*textInitVal;
>       char	*strInitVal, *initVal;
> -     extern char	*textout();
>       
>       Assert(PointerIsValid(aggName));
>       Assert(PointerIsValid(isNull));
> --- 269,274 ----
> Index: src/backend/optimizer/geqo/geqo_params.c
> Prereq:  1.2 
> *** postgresql-v6.1/src/backend/optimizer/geqo/geqo_params.c	Wed Feb 19 09:52:04 1997
> --- postgresql-v6.1-cc-fix/src/backend/optimizer/geqo/geqo_params.c	Thu Jun 19 16:39:38 1997
> ***************
> *** 22,27 ****
> --- 22,28 ----
>   #include 
>   #include 
>   #include 
> + #include 
>   
>   #include "postgres.h"
>   #include "miscadmin.h"
> Index: src/backend/parser/catalog_utils.c
> Prereq:  1.18 
> *** postgresql-v6.1/src/backend/parser/catalog_utils.c	Thu May 22 00:00:36 1997
> --- postgresql-v6.1-cc-fix/src/backend/parser/catalog_utils.c	Thu Jun 19 16:40:09 1997
> ***************
> *** 1477,1483 ****
>   void
>   func_error(char *caller, char *funcname, int nargs, Oid *argtypes)
>   {
> -     Type get_id_type();
>       char p[(NAMEDATALEN+2)*MAXFMGRARGS], *ptr;
>       int i;
>   	
> --- 1477,1482 ----
> Index: src/backend/parser/parser.c
> Prereq:  1.18 
> *** postgresql-v6.1/src/backend/parser/parser.c	Fri Feb 14 00:01:45 1997
> --- postgresql-v6.1-cc-fix/src/backend/parser/parser.c	Thu Jun 19 16:40:47 1997
> ***************
> *** 447,453 ****
>   	    vartype = ((Expr*)target)->typeOid;
>   
>   	if (basetype != vartype) {
> ! 	    Type tp1, tp2, get_id_type();
>   	    
>   	    tp1 = get_id_type(basetype);
>   	    tp2 = get_id_type(vartype);
> --- 447,453 ----
>   	    vartype = ((Expr*)target)->typeOid;
>   
>   	if (basetype != vartype) {
> ! 	    Type tp1, tp2;
>   	    
>   	    tp1 = get_id_type(basetype);
>   	    tp2 = get_id_type(vartype);
> Index: src/backend/rewrite/rewriteDefine.c
> Prereq:  1.2 
> *** postgresql-v6.1/src/backend/rewrite/rewriteDefine.c	Sun Nov 10 00:01:05 1996
> --- postgresql-v6.1-cc-fix/src/backend/rewrite/rewriteDefine.c	Thu Jun 19 16:41:38 1997
> ***************
> *** 192,199 ****
>       Oid event_attype	= 0;
>       char *actionP, *event_qualP;
>       
> -     extern Oid att_typeid();
> -     
>       if (event_obj->attrs)
>   	eslot_string = strVal(lfirst(event_obj->attrs));
>       else
> --- 192,197 ----
> Index: src/backend/storage/buffer/bufmgr.c
> Prereq:  1.13 
> *** postgresql-v6.1/src/backend/storage/buffer/bufmgr.c	Fri Apr 18 06:00:56 1997
> --- postgresql-v6.1-cc-fix/src/backend/storage/buffer/bufmgr.c	Thu Jun 19 16:42:18 1997
> ***************
> *** 1131,1137 ****
>   {
>       register int i;
>       int error = 0;
> -     void PrintBufferDescs();
>       
>       for (i = 1; i <= NBuffers; i++) {
>   	if (BufferIsValid(i)) {
> --- 1131,1136 ----
> Index: src/backend/storage/ipc/sinvaladt.c
> Prereq:  1.3 
> *** postgresql-v6.1/src/backend/storage/ipc/sinvaladt.c	Wed Nov  6 06:01:14 1996
> --- postgresql-v6.1-cc-fix/src/backend/storage/ipc/sinvaladt.c	Thu Jun 19 18:50:19 1997
> ***************
> *** 481,492 ****
>   {
>       Offset  	    offsetToNewData;
>       SISegEntry 	    *eP, *lastP;
> -     bool    	    SISegFull();
> -     Offset  	    SIEntryOffset();
> -     Offset  	    SIGetStartFreeSpace();
> -     SISegEntry 	    *SIGetFirstDataEntry();
> -     SISegEntry 	    *SIGetNextDataEntry();
> -     SISegEntry 	    *SIGetLastDataEntry();
>       
>       if (!SIIncNumEntries(segP, 1)) 
>   	return(false);  /* no space */
> --- 481,486 ----
> ***************
> *** 542,548 ****
>   SIDelDataEntry(SISeg *segP)
>   {
>       SISegEntry 	    *e1P;
> -     SISegEntry 	    *SIGetFirstDataEntry();
>       
>       if (!SIDecNumEntries(segP, 1))  {
>       	/* no entries in buffer */
> --- 536,541 ----
> Index: src/backend/storage/smgr/md.c
> Prereq:  1.13 
> *** postgresql-v6.1/src/backend/storage/smgr/md.c	Thu May 22 18:00:55 1997
> --- postgresql-v6.1-cc-fix/src/backend/storage/smgr/md.c	Thu Jun 19 16:43:50 1997
> ***************
> *** 114,120 ****
>   {
>       int fd, vfd;
>       char *path;
> -     extern bool IsBootstrapProcessingMode();
>   
>       path = relpath(&(reln->rd_rel->relname.data[0]));
>       fd = FileNameOpenFile(path, O_RDWR|O_CREAT|O_EXCL, 0600);
> --- 114,119 ----
> Index: src/backend/tcop/postgres.c
> Prereq:  1.33 
> *** postgresql-v6.1/src/backend/tcop/postgres.c	Thu Apr 24 00:01:21 1997
> --- postgresql-v6.1-cc-fix/src/backend/tcop/postgres.c	Thu Jun 19 17:17:32 1997
> ***************
> *** 54,59 ****
> --- 54,60 ----
>   #include "executor/execdebug.h"
>   #include "executor/executor.h"
>   #include "nodes/relation.h"
> + #include "nodes/print.h"
>   
>   #include "optimizer/cost.h"
>   #include "optimizer/planner.h"
> Index: src/backend/tcop/utility.c
> Prereq:  1.17 
> *** postgresql-v6.1/src/backend/tcop/utility.c	Thu May 22 00:01:03 1997
> --- postgresql-v6.1-cc-fix/src/backend/tcop/utility.c	Thu Jun 19 16:46:11 1997
> ***************
> *** 476,482 ****
>   		{
>   		    char *viewName = stmt->name;
>   		    char *ruleName;
> - 		    extern char *RewriteGetRuleEventRel();
>   
>   #ifndef NO_SECURITY
>   		
> --- 476,481 ----
> ***************
> *** 587,593 ****
>       case T_LoadStmt:
>   	{
>   	    LoadStmt *stmt = (LoadStmt *)parsetree;
> ! 	    FILE *fp, *fopen();
>   	    char *filename;
>   
>   	    commandTag = "LOAD";
> --- 586,592 ----
>       case T_LoadStmt:
>   	{
>   	    LoadStmt *stmt = (LoadStmt *)parsetree;
> ! 	    FILE *fp;
>   	    char *filename;
>   
>   	    commandTag = "LOAD";
> Index: src/backend/utils/adt/acl.c
> Prereq:  1.8 
> *** postgresql-v6.1/src/backend/utils/adt/acl.c	Wed Nov 20 18:00:59 1996
> --- postgresql-v6.1-cc-fix/src/backend/utils/adt/acl.c	Thu Jun 19 16:46:58 1997
> ***************
> *** 86,92 ****
>   {
>       HeapTuple htp;
>       char name[NAMEDATALEN+1];
> -     extern AclId get_grosysid();
>       
>       Assert(s && aip && modechg);
>       
> --- 86,91 ----
> Index: src/backend/utils/adt/arrayfuncs.c
> Prereq:  1.10 
> *** postgresql-v6.1/src/backend/utils/adt/arrayfuncs.c	Fri Nov  8 06:01:12 1996
> --- postgresql-v6.1-cc-fix/src/backend/utils/adt/arrayfuncs.c	Thu Jun 19 16:47:25 1997
> ***************
> *** 1203,1209 ****
>       int n, *dim, *lb, st_pos, prod[MAXDIM];
>       int span[MAXDIM], dist[MAXDIM], indx[MAXDIM];
>       int i, j, inc;
> !     char *srcPtr, *array_seek();
>       
>       n = ARR_NDIM(array); dim = ARR_DIMS(array);
>       lb = ARR_LBOUND(array); srcPtr = ARR_DATA_PTR(array);
> --- 1203,1209 ----
>       int n, *dim, *lb, st_pos, prod[MAXDIM];
>       int span[MAXDIM], dist[MAXDIM], indx[MAXDIM];
>       int i, j, inc;
> !     char *srcPtr;
>       
>       n = ARR_NDIM(array); dim = ARR_DIMS(array);
>       lb = ARR_LBOUND(array); srcPtr = ARR_DATA_PTR(array);
> ***************
> *** 1232,1238 ****
>       int span[MAXDIM], dist[MAXDIM], indx[MAXDIM];
>       int i, j, inc, st[MAXDIM], endp[MAXDIM];
>       int count = 0;
> !     char *ptr, *array_seek();
>       
>       n = ARR_NDIM(array); dim = ARR_DIMS(array);
>       lb = ARR_LBOUND(array); ptr = ARR_DATA_PTR(array);
> --- 1232,1238 ----
>       int span[MAXDIM], dist[MAXDIM], indx[MAXDIM];
>       int i, j, inc, st[MAXDIM], endp[MAXDIM];
>       int count = 0;
> !     char *ptr;
>       
>       n = ARR_NDIM(array); dim = ARR_DIMS(array);
>       lb = ARR_LBOUND(array); ptr = ARR_DATA_PTR(array);
> Index: src/backend/utils/adt/dt.c
> Prereq:  1.24 
> *** postgresql-v6.1/src/backend/utils/adt/dt.c	Tue Jun  3 06:01:00 1997
> --- postgresql-v6.1-cc-fix/src/backend/utils/adt/dt.c	Thu Jun 19 15:11:57 1997
> ***************
> *** 1236,1243 ****
>    *****************************************************************************/
>   
>   /* definitions for squeezing values into "value" */
> ! #define ABS_SIGNBIT	0200
> ! #define VALMASK		0177
>   #define NEG(n)		((n)|ABS_SIGNBIT)
>   #define SIGNEDCHAR(c)	((c)&ABS_SIGNBIT? -((c)&VALMASK): (c))
>   #define FROMVAL(tp)	(-SIGNEDCHAR((tp)->value) * 10)	/* uncompress */
> --- 1236,1243 ----
>    *****************************************************************************/
>   
>   /* definitions for squeezing values into "value" */
> ! #define ABS_SIGNBIT	(char) 0200
> ! #define VALMASK		(char) 0177
>   #define NEG(n)		((n)|ABS_SIGNBIT)
>   #define SIGNEDCHAR(c)	((c)&ABS_SIGNBIT? -((c)&VALMASK): (c))
>   #define FROMVAL(tp)	(-SIGNEDCHAR((tp)->value) * 10)	/* uncompress */
> Index: src/backend/utils/adt/filename.c
> Prereq:  1.6 
> *** postgresql-v6.1/src/backend/utils/adt/filename.c	Fri Feb 14 00:02:24 1997
> --- postgresql-v6.1-cc-fix/src/backend/utils/adt/filename.c	Thu Jun 19 16:48:05 1997
> ***************
> *** 25,31 ****
>   char *
>   filename_in(char *file)
>   {
> !     char *str, *getenv();
>       int ind = 0;
>       
>       /*
> --- 25,31 ----
>   char *
>   filename_in(char *file)
>   {
> !     char *str;
>       int ind = 0;
>       
>       /*
> Index: src/backend/utils/adt/oid.c
> Prereq:  1.6 
> *** postgresql-v6.1/src/backend/utils/adt/oid.c	Sat Mar 15 00:01:42 1997
> --- postgresql-v6.1-cc-fix/src/backend/utils/adt/oid.c	Thu Jun 19 16:48:41 1997
> ***************
> *** 84,98 ****
>   
>   Oid oidin(char *s)
>   {
> -     extern int32 int4in();
> -     
>       return(int4in(s));
>   }
>   
>   char *oidout(Oid o)
>   {
> -     extern char *int4out();
> -     
>       return(int4out(o));
>   }
>   
> --- 84,94 ----
> Index: src/backend/utils/error/elog.c
> Prereq:  1.15 
> *** postgresql-v6.1/src/backend/utils/error/elog.c	Tue Mar 18 18:01:14 1997
> --- postgresql-v6.1-cc-fix/src/backend/utils/error/elog.c	Thu Jun 19 16:49:05 1997
> ***************
> *** 50,56 ****
>   #ifndef PG_STANDALONE
>       extern	FILE	*Pfout;
>   #endif /* !PG_STANDALONE */
> -     time_t	time();
>   #ifdef ELOG_TIMESTAMPS
>       time_t	tim;
>   #endif
> --- 50,55 ----
> Index: src/backend/utils/fmgr/dfmgr.c
> Prereq:  1.6 
> *** postgresql-v6.1/src/backend/utils/fmgr/dfmgr.c	Fri Feb 14 00:02:28 1997
> --- postgresql-v6.1-cc-fix/src/backend/utils/fmgr/dfmgr.c	Thu Jun 19 16:49:29 1997
> ***************
> *** 53,59 ****
>       Form_pg_proc procedureStruct;
>       char        *proname;
>       char        *probinattr, *probinstring;
> !     func_ptr    user_fn, handle_load();
>       Relation    rdesc;
>       bool     isnull;
>       
> --- 53,59 ----
>       Form_pg_proc procedureStruct;
>       char        *proname;
>       char        *probinattr, *probinstring;
> !     func_ptr    user_fn;
>       Relation    rdesc;
>       bool     isnull;
>       
> Index: src/backend/utils/init/postinit.c
> Prereq:  1.8 
> *** postgresql-v6.1/src/backend/utils/init/postinit.c	Fri Feb 14 00:02:31 1997
> --- postgresql-v6.1-cc-fix/src/backend/utils/init/postinit.c	Thu Jun 19 16:50:29 1997
> ***************
> *** 354,360 ****
>   void
>   InitCommunication()
>   {
> -     char *getenv();     /* XXX style */
>       char *postid;
>       char *postport;
>       IPCKey      key = 0;
> --- 354,359 ----
> Index: src/backend/utils/sort/psort.c
> Prereq:  1.4 
> *** postgresql-v6.1/src/backend/utils/sort/psort.c	Tue May 20 12:01:17 1997
> --- postgresql-v6.1-cc-fix/src/backend/utils/sort/psort.c	Thu Jun 19 16:51:06 1997
> ***************
> *** 525,531 ****
>       register struct	tapelst	*tp;
>       FILE		*file;
>       static	int	tapeinit = 0;
> -     char		*mktemp();
>       
>       tp = (struct tapelst *)palloc((unsigned)sizeof (struct tapelst));
>       if (!tapeinit) {
> --- 525,530 ----
> Index: src/include/regex/regex2.h
> Prereq: 	8.4 
> *** postgresql-v6.1/src/include/regex/regex2.h	Fri Sep 20 01:29:28 1996
> --- postgresql-v6.1-cc-fix/src/include/regex/regex2.h	Thu Jun 19 14:54:51 1997
> ***************
> *** 87,112 ****
>   #define	SOP(op, opnd)	((op)|(opnd))
>   /* operators			   meaning	operand			*/
>   /*						(back, fwd are offsets)	*/
> ! #define	OEND	(1< ! #define	OCHAR	(2< ! #define	OBOL	(3< ! #define	OEOL	(4< ! #define	OANY	(5< ! #define	OANYOF	(6< ! #define	OBACK_	(7< ! #define	O_BACK	(8< ! #define	OPLUS_	(9< ! #define	O_PLUS	(10< ! #define	OQUEST_	(11< ! #define	O_QUEST	(12< ! #define	OLPAREN	(13< ! #define	ORPAREN	(14< ! #define	OCH_	(15< ! #define	OOR1	(16< ! #define	OOR2	(17< ! #define	O_CH	(18< ! #define	OBOW	(19< ! #define	OEOW	(20<   
>   /*
>    * Structure for [] character-set representation.  Character sets are
> --- 87,112 ----
>   #define	SOP(op, opnd)	((op)|(opnd))
>   /* operators			   meaning	operand			*/
>   /*						(back, fwd are offsets)	*/
> ! #define	OEND	((size_t)1< ! #define	OCHAR	((size_t)2< ! #define	OBOL	((size_t)3< ! #define	OEOL	((size_t)4< ! #define	OANY	((size_t)5< ! #define	OANYOF	((size_t)6< ! #define	OBACK_	((size_t)7< ! #define	O_BACK	((size_t)8< ! #define	OPLUS_	((size_t)9< ! #define	O_PLUS	((size_t)10< ! #define	OQUEST_	((size_t)11< ! #define	O_QUEST	((size_t)12< ! #define	OLPAREN	((size_t)13< ! #define	ORPAREN	((size_t)14< ! #define	OCH_	((size_t)15< ! #define	OOR1	((size_t)16< ! #define	OOR2	((size_t)17< ! #define	O_CH	((size_t)18< ! #define	OBOW	((size_t)19< ! #define	OEOW	((size_t)20<   
>   /*
>    * Structure for [] character-set representation.  Character sets are
> Index: src/template/sparc_solaris-cc
> *** postgresql-v6.1/src/template/sparc_solaris-cc	Fri Apr 11 18:02:29 1997
> --- postgresql-v6.1-cc-fix/src/template/sparc_solaris-cc	Thu Jun 19 16:13:48 1997
> ***************
> *** 1,5 ****
>   AROPT:crs
> ! CFLAGS:-I$(SRCDIR)/backend/port/sparc_solaris
>   SHARED_LIB:-K PIC
>   ALL:
>   SRCH_INC:
> --- 1,5 ----
>   AROPT:crs
> ! CFLAGS:-I$(SRCDIR)/backend/port/sparc_solaris -Xa -v
>   SHARED_LIB:-K PIC
>   ALL:
>   SRCH_INC:
> 
> 


- -- 
Bruce Momjian
maillist@candle.pha.pa.us

------------------------------

Re: [HACKERS] [PATCHES] fixes for sparc-solaris (fwd)

От:
"Thomas G. Lockhart" <Thomas.Lockhart@jpl.nasa.gov>
Дата:
> Any comments on applying this?  It looks good to me.

It's amazing that with all of the testing this is the first indication
of a problem (with code which has been through several revs even).

Have you tried the patches through the regression tests?

			- Tom

> > Your name             : Diab Jerius
> > Your email address    : djerius@cfa.harvard.edu
> >   Architecture (example: Intel Pentium)       : Sparc
> >   Operating System (example: Linux 2.0.26 ELF)        : Solaris 2.5.1
> >   PostgreSQL version (example: PostgreSQL-6.1)  : PostgreSQL-6.1
> >   Compiler used (example:  gcc 2.7.2)         : SunOS cc 4.0.1
> > Various compile errors concerning overflow due to shifts (<<) and
> > masking of chars with constants.  The first set of errors is due to
> > the compiler holding the result in a signed int ( e.g. 15 << 27 is
> > too big for a signed int, bug fits just fine in an unsigned one)
> > while the destination was unsigned.
> >
> > The second was caused by masking a signed char with a number greater
> > than 127; this caused a warning about the result not fitting.
> >
> > There were various spots where old K&R type prototypes were present
> > and overrode true prototypes specified elsewhere.
> >
> > the sparc_solaris-cc file should have more strict ANSI flags.

------------------------------

Re: [HACKERS] [PATCHES] fixes for sparc-solaris (fwd)

От:
hotz@jpl.nasa.gov (Henry B. Hotz)
Дата:
At 6:02 PM 6/25/97, Thomas G. Lockhart wrote:
>> Any comments on applying this?  It looks good to me.
>
>It's amazing that with all of the testing this is the first indication
>of a problem (with code which has been through several revs even).
>
>Have you tried the patches through the regression tests?
>
>                        - Tom
>
>> > Your name             : Diab Jerius
>> > Your email address    : djerius@cfa.harvard.edu
>> >   Architecture (example: Intel Pentium)       : Sparc
>> >   Operating System (example: Linux 2.0.26 ELF)        : Solaris 2.5.1
>> >   PostgreSQL version (example: PostgreSQL-6.1)  : PostgreSQL-6.1
>> >   Compiler used (example:  gcc 2.7.2)         : SunOS cc 4.0.1

Note that he is using the Sun payware cc compiler.  It should be a good
compiler, but very different in its quirks.  I suspect most users have been
using gcc for a long time, even on platforms that are otherwise dissimilar
like Linux vice *BSD.

Also note he is on Solaris 2, which is not the most standard of Unix
implementations.

Signature failed Preliminary Design Review.
Feasibility of a new signature is currently being evaluated.
h.b.hotz@jpl.nasa.gov, or hbhotz@oxy.edu

------------------------------
FAQ