]> granicus.if.org Git - postgresql/commitdiff
Remove unreachable code
authorPeter Eisentraut <peter_e@gmx.net>
Mon, 16 Jul 2012 19:15:03 +0000 (22:15 +0300)
committerPeter Eisentraut <peter_e@gmx.net>
Mon, 16 Jul 2012 19:15:03 +0000 (22:15 +0300)
The Solaris Studio compiler warns about these instances, unlike more
mainstream compilers such as gcc.  But manual inspection showed that
the code is clearly not reachable, and we hope no worthy compiler will
complain about removing this code.

20 files changed:
contrib/hstore/hstore_io.c
contrib/intarray/_int_bool.c
contrib/intarray/_int_gist.c
contrib/ltree/ltxtquery_io.c
contrib/ltree/ltxtquery_op.c
src/backend/access/gin/ginbtree.c
src/backend/access/gin/ginget.c
src/backend/access/gist/gistget.c
src/backend/executor/nodeGroup.c
src/backend/libpq/be-secure.c
src/backend/storage/buffer/freelist.c
src/backend/tcop/postgres.c
src/backend/tsearch/dict_thesaurus.c
src/backend/utils/adt/formatting.c
src/backend/utils/adt/tsquery.c
src/backend/utils/adt/tsvector_parser.c
src/bin/pg_basebackup/pg_receivexlog.c
src/bin/psql/variables.c
src/interfaces/ecpg/ecpglib/typename.c
src/pl/plpgsql/src/pl_exec.c

index aadf050410eb62b61e306fef0e94621ac7d6c2ad..7bdac3d94cbde788b7e11b479b8be6dac7c1725b 100644 (file)
@@ -163,8 +163,6 @@ get_val(HSParser *state, bool ignoreeq, bool *escaped)
 
                state->ptr++;
        }
-
-       return false;
 }
 
 #define WKEY   0
index dfb113a8ea5f89fe61d85977913b26b20cf7d828..d0572afc1e34dec55deaec8fcbd82d74a419422a 100644 (file)
@@ -136,7 +136,6 @@ gettoken(WORKSTATE *state, int32 *val)
                }
                (state->buf)++;
        }
-       return END;
 }
 
 /*
@@ -301,7 +300,6 @@ execute(ITEM *curitem, void *checkval, bool calcnot,
                else
                        return execute(curitem - 1, checkval, calcnot, chkcond);
        }
-       return false;
 }
 
 /*
@@ -404,7 +402,6 @@ contains_required_value(ITEM *curitem)
                else
                        return false;
        }
-       return false;
 }
 
 bool
index e429c8b58c95ae91607f5bbadf53321e88cf93dd..60de393bdf1d665d1a6fe60729cb6e9eda1f6257 100644 (file)
@@ -217,8 +217,6 @@ g_int_compress(PG_FUNCTION_ARGS)
        }
        else
                PG_RETURN_POINTER(entry);
-
-       PG_RETURN_POINTER(entry);
 }
 
 Datum
index c2e532c3b819da76997b34c332d6dad234e3fd0e..583ff2aaebbb3078a8e48765c107c642e26a8b4f 100644 (file)
@@ -139,7 +139,6 @@ gettoken_query(QPRS_STATE *state, int32 *val, int32 *lenval, char **strval, uint
 
                state->buf += charlen;
        }
-       return END;
 }
 
 /*
index bedbe247eb8b0143f803dfc7b6e0cba6f1e2a735..64f9d219f76785dd08336c450fea6109e7e0733b 100644 (file)
@@ -40,7 +40,6 @@ ltree_execute(ITEM *curitem, void *checkval, bool calcnot, bool (*chkcond) (void
                else
                        return ltree_execute(curitem + 1, checkval, calcnot, chkcond);
        }
-       return false;
 }
 
 typedef struct
index 82ac53e148724502e5bd51a33df37a040274c53d..3efdedd180ed9634efd709274e9689447895df12 100644 (file)
@@ -146,9 +146,6 @@ ginFindLeafPage(GinBtree btree, GinBtreeStack *stack)
                        stack->predictNumber = 1;
                }
        }
-
-       /* keep compiler happy */
-       return NULL;
 }
 
 void
index 022bd27b2341f776e71aa1994712a6b7840eb061..57022594bf6f87f751e22f924988199dfc8fc98a 100644 (file)
@@ -354,8 +354,6 @@ collectMatchBitmap(GinBtreeData *btree, GinBtreeStack *stack,
                 */
                stack->off++;
        }
-
-       return true;
 }
 
 /*
index c790ad6ffb4a655df1c4471f49001a5b8e83a807..2253e7c0eb77487e39100af2c35df4e26eb7a8f8 100644 (file)
@@ -535,8 +535,6 @@ gistgettuple(PG_FUNCTION_ARGS)
                        } while (so->nPageData == 0);
                }
        }
-
-       PG_RETURN_BOOL(false);          /* keep compiler quiet */
 }
 
 /*
index 80e282bbf45a707f58692b7d03cc9da4cc0cc49e..a8a1fe6aaea9373a5ad8e784fa2ae9236cf5c6c8 100644 (file)
@@ -184,9 +184,6 @@ ExecGroup(GroupState *node)
                else
                        InstrCountFiltered1(node, 1);
        }
-
-       /* NOTREACHED */
-       return NULL;
 }
 
 /* -----------------
index e0ab5997fbd9337d07a38e6fe79b7f144c6d6d04..0d66dab42d5eae2c6ed598f4699de0a8aa3f56d1 100644 (file)
@@ -201,9 +201,9 @@ secure_loaded_verify_locations(void)
 {
 #ifdef USE_SSL
        return ssl_loaded_verify_locations;
-#endif
-
+#else
        return false;
+#endif
 }
 
 /*
index c92774798cfc57d3f35b5a959d384b8ace77d1c7..d96b7a7b0550ee96f7b422c4919e99e907c6ef87 100644 (file)
@@ -233,9 +233,6 @@ StrategyGetBuffer(BufferAccessStrategy strategy, bool *lock_held)
                }
                UnlockBufHdr(buf);
        }
-
-       /* not reached */
-       return NULL;
 }
 
 /*
index 9a5438f18afa707d385177fb136f4356863e542a..f696375cabc5d5e2ddbd3689aaebc13616fddac8 100644 (file)
@@ -4198,11 +4198,6 @@ PostgresMain(int argc, char *argv[], const char *username)
                                                                firstchar)));
                }
        }                                                       /* end of input-reading loop */
-
-       /* can't get here because the above loop never exits */
-       Assert(false);
-
-       abort();                                        /* keep compiler quiet */
 }
 
 
index 7e641ef64f55a9f56658127f08b50aa9f11eeee5..1f52372a48dd011eead29e4352fd6176669f14f1 100644 (file)
@@ -744,8 +744,6 @@ findVariant(LexemeInfo *in, LexemeInfo *stored, uint16 curpos, LexemeInfo **newi
                for (i = 0; i < newn; i++)
                        newin[i] = newin[i]->nextentry;
        }
-
-       return NULL;
 }
 
 static TSLexeme *
index b46cb87615060cd02eec9f8b642a247cf035c72e..4347ad317faf29cd400e17e9b0e523f56021c464 100644 (file)
@@ -1439,7 +1439,6 @@ get_th(char *num, int type)
                                return numTH[3];
                        return numth[3];
        }
-       return NULL;
 }
 
 /* ----------
index 010167a8a923b8228f0a18d08694c417f0ef3bf6..b7c46abd050948ff9dcf19efc2ead6d2d1669a4b 100644 (file)
@@ -216,7 +216,6 @@ gettoken_query(TSQueryParserState state,
                }
                state->buf += pg_mblen(state->buf);
        }
-       return PT_END;
 }
 
 /*
index 5214fce7a6d0644d498aa86fd66e5324524d7a48..058b30fe25bf2374b4d14905f5c35fa94d5785ef 100644 (file)
@@ -362,6 +362,4 @@ gettoken_tsvector(TSVectorParseState state,
                /* get next char */
                state->prsbuf += pg_mblen(state->prsbuf);
        }
-
-       return false;
 }
index dbc6ecf431de12bb8401cf179969483662dfe965..c4e1d2a682ec3f3b6a893b41834f66daf3239a51 100644 (file)
@@ -435,7 +435,4 @@ main(int argc, char **argv)
                        pg_usleep(RECONNECT_SLEEP_TIME * 1000000);
                }
        }
-
-       /* Never get here */
-       exit(2);
 }
index 4baa3e253a17538c19e3d72062da4aff8a7395df..6875f63dc18d98028a0b0db24a20fb6d291f4a19 100644 (file)
@@ -115,8 +115,6 @@ ParseVariableBool(const char *value)
                psql_error("unrecognized Boolean value; assuming \"on\"\n");
                return true;
        }
-       /* suppress compiler warning */
-       return true;
 }
 
 
index d4bfd0d35d80e3e31a9b76d7413dc740e9de54ad..98b81894f35683c5ca20313825110bffee7683ce 100644 (file)
@@ -65,7 +65,6 @@ ecpg_type_name(enum ECPGttype typ)
                default:
                        abort();
        }
-       return NULL;
 }
 
 int
index 8ca791ce3f42486a8dc47634397600d4b2b7c915..11a56c9a8f1fd49bcc0eaabfccdcaa5b770a3944 100644 (file)
@@ -1663,8 +1663,6 @@ exec_stmt_loop(PLpgSQL_execstate *estate, PLpgSQL_stmt_loop *stmt)
                                elog(ERROR, "unrecognized rc: %d", rc);
                }
        }
-
-       return PLPGSQL_RC_OK;
 }