Initialize variables to placate compiler.
authorNathan Bossart <[email protected]>
Mon, 18 Mar 2024 01:16:15 +0000 (20:16 -0500)
committerNathan Bossart <[email protected]>
Mon, 18 Mar 2024 01:16:15 +0000 (20:16 -0500)
Since commit 012460ee93, some compilers have been warning that a
couple of variables may be used uninitialized.  There doesn't
appear to be any actual risk, so let's just initialize these
variables to 0 to silence the compiler warnings.

Discussion: https://postgr.es/m/20240317192927.GA3978212%40nathanxps13

src/backend/commands/statscmds.c
src/backend/commands/tablecmds.c

index 5f49479832d9192a7d28a704c2d465aa8d20f214..1db3ef69d22fc19784927dffd6fc33e04f97f283 100644 (file)
@@ -606,7 +606,7 @@ AlterStatistics(AlterStatsStmt *stmt)
    bool        repl_null[Natts_pg_statistic_ext];
    bool        repl_repl[Natts_pg_statistic_ext];
    ObjectAddress address;
-   int         newtarget;
+   int         newtarget = 0;
    bool        newtarget_default;
 
    /* -1 was used in previous versions for the default setting */
index ae6719329e7df36e3f82fabff88321ce7438f502..3ed0618b4e609cd626f5ea2fc524c1650d16f766 100644 (file)
@@ -8711,7 +8711,7 @@ ATExecDropExpression(Relation rel, const char *colName, bool missing_ok, LOCKMOD
 static ObjectAddress
 ATExecSetStatistics(Relation rel, const char *colName, int16 colNum, Node *newValue, LOCKMODE lockmode)
 {
-   int         newtarget;
+   int         newtarget = 0;
    bool        newtarget_default;
    Relation    attrelation;
    HeapTuple   tuple,