Suppress a few 'uninitialized variable' warnings that gcc emits only at
authorTom Lane <tgl@sss.pgh.pa.us>
Sat, 11 Nov 2006 01:14:19 +0000 (01:14 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Sat, 11 Nov 2006 01:14:19 +0000 (01:14 +0000)
-O3 or higher (presumably because it inlines more things).  Per gripe
from Mark Mielke.

src/backend/access/nbtree/nbtinsert.c
src/backend/optimizer/path/costsize.c
src/backend/utils/adt/timestamp.c

index 14423c671110c2f94e68a39cd1614e664466a99e..c528460b6226b6fc06a8b0264d8430645c1cae44 100644 (file)
@@ -8,7 +8,7 @@
  *
  *
  * IDENTIFICATION
- *   $PostgreSQL: pgsql/src/backend/access/nbtree/nbtinsert.c,v 1.145 2006/11/01 19:43:17 tgl Exp $
+ *   $PostgreSQL: pgsql/src/backend/access/nbtree/nbtinsert.c,v 1.146 2006/11/11 01:14:18 tgl Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -1082,6 +1082,9 @@ _bt_findsplitloc(Relation rel,
                                                 BTREE_DEFAULT_FILLFACTOR);
    else
        state.fillfactor = BTREE_NONLEAF_FILLFACTOR;
+   state.newitemonleft = false;    /* these just to keep compiler quiet */
+   state.firstright = 0;
+   state.best_delta = 0;
 
    /* Total free space available on a btree page, after fixed overhead */
    leftspace = rightspace =
index 749cbd5b5d6a2cb0d5e827073564585f68e0ed6b..ffe06f23ff4e267aa714069fb46a818f0b0ceed0 100644 (file)
@@ -54,7 +54,7 @@
  * Portions Copyright (c) 1994, Regents of the University of California
  *
  * IDENTIFICATION
- *   $PostgreSQL: pgsql/src/backend/optimizer/path/costsize.c,v 1.168 2006/11/10 01:21:41 tgl Exp $
+ *   $PostgreSQL: pgsql/src/backend/optimizer/path/costsize.c,v 1.169 2006/11/11 01:14:19 tgl Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -626,7 +626,10 @@ cost_bitmap_tree_node(Path *path, Cost *cost, Selectivity *selec)
        *selec = ((BitmapOrPath *) path)->bitmapselectivity;
    }
    else
+   {
        elog(ERROR, "unrecognized node type: %d", nodeTag(path));
+       *cost = *selec = 0;     /* keep compiler quiet */
+   }
 }
 
 /*
index e06fa99dc178ec75f9f8d9337aa4e94f373d8011..f94413e3f32cafb600e0418b4914c2600a8bebe5 100644 (file)
@@ -8,7 +8,7 @@
  *
  *
  * IDENTIFICATION
- *   $PostgreSQL: pgsql/src/backend/utils/adt/timestamp.c,v 1.168 2006/10/04 00:29:59 momjian Exp $
+ *   $PostgreSQL: pgsql/src/backend/utils/adt/timestamp.c,v 1.169 2006/11/11 01:14:19 tgl Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -1257,7 +1257,10 @@ tm2timestamp(struct pg_tm * tm, fsec_t fsec, int *tzp, Timestamp *result)
 
    /* Julian day routines are not correct for negative Julian days */
    if (!IS_VALID_JULIAN(tm->tm_year, tm->tm_mon, tm->tm_mday))
+   {
+       *result = 0;            /* keep compiler quiet */
        return -1;
+   }
 
    date = date2j(tm->tm_year, tm->tm_mon, tm->tm_mday) - POSTGRES_EPOCH_JDATE;
    time = time2t(tm->tm_hour, tm->tm_min, tm->tm_sec, fsec);
@@ -1266,11 +1269,17 @@ tm2timestamp(struct pg_tm * tm, fsec_t fsec, int *tzp, Timestamp *result)
    *result = date * USECS_PER_DAY + time;
    /* check for major overflow */
    if ((*result - time) / USECS_PER_DAY != date)
+   {
+       *result = 0;            /* keep compiler quiet */
        return -1;
+   }
    /* check for just-barely overflow (okay except time-of-day wraps) */
    if ((*result < 0 && date >= 0) ||
        (*result >= 0 && date < 0))
+   {
+       *result = 0;            /* keep compiler quiet */
        return -1;
+   }
 #else
    *result = date * SECS_PER_DAY + time;
 #endif