]> granicus.if.org Git - postgresql/commitdiff
This patch will stop gcc from issuing warnings about type-punned objects
authorBruce Momjian <bruce@momjian.us>
Sat, 11 Oct 2003 16:30:55 +0000 (16:30 +0000)
committerBruce Momjian <bruce@momjian.us>
Sat, 11 Oct 2003 16:30:55 +0000 (16:30 +0000)
when -fstrict-aliasing is turned on, as it is in the latest gcc when you
use -O2

Andrew Dunstan

src/backend/commands/tablecmds.c
src/backend/executor/execQual.c
src/backend/port/sysv_shmem.c
src/backend/storage/lmgr/proc.c
src/bin/psql/command.c

index 395077081a7f595385ab311b23af33b664511f18..d5c7ac27f29fe2aca1fa4d5466fd5dbfd418145f 100644 (file)
@@ -8,7 +8,7 @@
  *
  *
  * IDENTIFICATION
- *       $Header: /cvsroot/pgsql/src/backend/commands/tablecmds.c,v 1.86 2003/10/06 16:38:27 tgl Exp $
+ *       $Header: /cvsroot/pgsql/src/backend/commands/tablecmds.c,v 1.87 2003/10/11 16:30:54 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -3525,7 +3525,7 @@ validateForeignKeyConstraint(FkConstraint *fkconstraint,
                trigdata.tg_newtuple = NULL;
                trigdata.tg_trigger = &trig;
 
-               fcinfo.context = (Node *) &trigdata;
+               fcinfo.context = (void *) &trigdata;
 
                RI_FKey_check_ins(&fcinfo);
        }
index 74560b1ba1dd82f2d0a5cd3f3d5ec85c73fdc9ce..8a963f88cb604cd9274b17f2b7644834d195951a 100644 (file)
@@ -8,7 +8,7 @@
  *
  *
  * IDENTIFICATION
- *       $Header: /cvsroot/pgsql/src/backend/executor/execQual.c,v 1.146 2003/09/25 23:02:11 tgl Exp $
+ *       $Header: /cvsroot/pgsql/src/backend/executor/execQual.c,v 1.147 2003/10/11 16:30:54 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -746,7 +746,7 @@ ExecMakeFunctionResult(FuncExprState *fcache,
         */
        if (fcache->func.fn_retset)
        {
-               fcinfo.resultinfo = (Node *) &rsinfo;
+               fcinfo.resultinfo = (void *) &rsinfo;
                rsinfo.type = T_ReturnSetInfo;
                rsinfo.econtext = econtext;
                rsinfo.expectedDesc = NULL;
@@ -992,7 +992,7 @@ ExecMakeTableFunctionResult(ExprState *funcexpr,
         * doesn't actually get to see the resultinfo, but set it up anyway
         * because we use some of the fields as our own state variables.
         */
-       fcinfo.resultinfo = (Node *) &rsinfo;
+       fcinfo.resultinfo = (void *) &rsinfo;
        rsinfo.type = T_ReturnSetInfo;
        rsinfo.econtext = econtext;
        rsinfo.expectedDesc = expectedDesc;
index e72818b11df298675bb02e64f0113c880012cf96..c7fff5bb7bcbb2b414ded657ff5fc76ba08e715f 100644 (file)
@@ -10,7 +10,7 @@
  * Portions Copyright (c) 1994, Regents of the University of California
  *
  * IDENTIFICATION
- *       $Header: /cvsroot/pgsql/src/backend/port/sysv_shmem.c,v 1.17 2003/09/29 00:05:25 petere Exp $
+ *       $Header: /cvsroot/pgsql/src/backend/port/sysv_shmem.c,v 1.18 2003/10/11 16:30:55 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -365,7 +365,7 @@ PGSharedMemoryAttach(IpcMemoryKey key, IpcMemoryId *shmid)
 
        if (hdr->magic != PGShmemMagic)
        {
-               shmdt(hdr);
+               shmdt((void *) hdr);
                return NULL;                    /* segment belongs to a non-Postgres app */
        }
 
index 8f5ab68dc0ca3edec939ffe208726fb19dc67fb0..5c0eb76935f278a4bd6a999edab973f88a98b705 100644 (file)
@@ -8,7 +8,7 @@
  *
  *
  * IDENTIFICATION
- *       $Header: /cvsroot/pgsql/src/backend/storage/lmgr/proc.c,v 1.133 2003/08/04 02:40:03 momjian Exp $
+ *       $Header: /cvsroot/pgsql/src/backend/storage/lmgr/proc.c,v 1.134 2003/10/11 16:30:55 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -1013,7 +1013,7 @@ enable_sig_alarm(int delayms, bool is_statement_timeout)
 
        /* If we reach here, okay to set the timer interrupt */
 #ifndef __BEOS__
-       MemSet(&timeval, 0, sizeof(struct itimerval));
+       MemSet((void *)&timeval, 0, sizeof(struct itimerval));
        timeval.it_value.tv_sec = delayms / 1000;
        timeval.it_value.tv_usec = (delayms % 1000) * 1000;
        if (setitimer(ITIMER_REAL, &timeval, NULL))
@@ -1054,7 +1054,7 @@ disable_sig_alarm(bool is_statement_timeout)
 #ifndef __BEOS__
                struct itimerval timeval;
 
-               MemSet(&timeval, 0, sizeof(struct itimerval));
+               MemSet((void *)&timeval, 0, sizeof(struct itimerval));
                if (setitimer(ITIMER_REAL, &timeval, NULL))
                {
                        statement_timeout_active = deadlock_timeout_active = false;
@@ -1120,7 +1120,7 @@ CheckStatementTimeout(void)
 #ifndef __BEOS__
                struct itimerval timeval;
 
-               MemSet(&timeval, 0, sizeof(struct itimerval));
+               MemSet((void *)&timeval, 0, sizeof(struct itimerval));
                timeval.it_value.tv_sec = statement_fin_time.tv_sec - now.tv_sec;
                timeval.it_value.tv_usec = statement_fin_time.tv_usec - now.tv_usec;
                if (timeval.it_value.tv_usec < 0)
index ce5379e4f6f90106584ed918768c4a923ab4395e..87ae1dc7c6522b29a4b7057d2b1560e712bb313f 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 2000-2003, PostgreSQL Global Development Group
  *
- * $Header: /cvsroot/pgsql/src/bin/psql/command.c,v 1.103 2003/09/29 16:39:18 petere Exp $
+ * $Header: /cvsroot/pgsql/src/bin/psql/command.c,v 1.104 2003/10/11 16:30:55 momjian Exp $
  */
 #include "postgres_fe.h"
 #include "command.h"
@@ -1280,7 +1280,7 @@ unescape(const unsigned char *source, size_t len)
                                case '7':
                                case '8':
                                case '9':
-                                       c = parse_char((char **) &p);
+                                       c = parse_char((void *) &p);
                                        break;
 
                                default: