Content-Length: 815147 | pFad | http://github.com/tonybelloni/postgres/commit/dd16f9480ac67ab0c6b0102d110cd5121ed9ab46

C6 Remove unreachable code · tonybelloni/postgres@dd16f94 · GitHub
Skip to content

Commit dd16f94

Browse files
committed
Remove unreachable code
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.
1 parent a76c857 commit dd16f94

File tree

20 files changed

+2
-43
lines changed

20 files changed

+2
-43
lines changed

contrib/hstore/hstore_io.c

-2
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,6 @@ get_val(HSParser *state, bool ignoreeq, bool *escaped)
163163

164164
state->ptr++;
165165
}
166-
167-
return false;
168166
}
169167

170168
#define WKEY 0

contrib/intarray/_int_bool.c

-3
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,6 @@ gettoken(WORKSTATE *state, int32 *val)
136136
}
137137
(state->buf)++;
138138
}
139-
return END;
140139
}
141140

142141
/*
@@ -301,7 +300,6 @@ execute(ITEM *curitem, void *checkval, bool calcnot,
301300
else
302301
return execute(curitem - 1, checkval, calcnot, chkcond);
303302
}
304-
return false;
305303
}
306304

307305
/*
@@ -404,7 +402,6 @@ contains_required_value(ITEM *curitem)
404402
else
405403
return false;
406404
}
407-
return false;
408405
}
409406

410407
bool

contrib/intarray/_int_gist.c

-2
Original file line numberDiff line numberDiff line change
@@ -217,8 +217,6 @@ g_int_compress(PG_FUNCTION_ARGS)
217217
}
218218
else
219219
PG_RETURN_POINTER(entry);
220-
221-
PG_RETURN_POINTER(entry);
222220
}
223221

224222
Datum

contrib/ltree/ltxtquery_io.c

-1
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,6 @@ gettoken_query(QPRS_STATE *state, int32 *val, int32 *lenval, char **strval, uint
139139

140140
state->buf += charlen;
141141
}
142-
return END;
143142
}
144143

145144
/*

contrib/ltree/ltxtquery_op.c

-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ ltree_execute(ITEM *curitem, void *checkval, bool calcnot, bool (*chkcond) (void
4040
else
4141
return ltree_execute(curitem + 1, checkval, calcnot, chkcond);
4242
}
43-
return false;
4443
}
4544

4645
typedef struct

src/backend/access/gin/ginbtree.c

-3
Original file line numberDiff line numberDiff line change
@@ -146,9 +146,6 @@ ginFindLeafPage(GinBtree btree, GinBtreeStack *stack)
146146
stack->predictNumber = 1;
147147
}
148148
}
149-
150-
/* keep compiler happy */
151-
return NULL;
152149
}
153150

154151
void

src/backend/access/gin/ginget.c

-2
Original file line numberDiff line numberDiff line change
@@ -354,8 +354,6 @@ collectMatchBitmap(GinBtreeData *btree, GinBtreeStack *stack,
354354
*/
355355
stack->off++;
356356
}
357-
358-
return true;
359357
}
360358

361359
/*

src/backend/access/gist/gistget.c

-2
Original file line numberDiff line numberDiff line change
@@ -535,8 +535,6 @@ gistgettuple(PG_FUNCTION_ARGS)
535535
} while (so->nPageData == 0);
536536
}
537537
}
538-
539-
PG_RETURN_BOOL(false); /* keep compiler quiet */
540538
}
541539

542540
/*

src/backend/executor/nodeGroup.c

-3
Original file line numberDiff line numberDiff line change
@@ -184,9 +184,6 @@ ExecGroup(GroupState *node)
184184
else
185185
InstrCountFiltered1(node, 1);
186186
}
187-
188-
/* NOTREACHED */
189-
return NULL;
190187
}
191188

192189
/* -----------------

src/backend/libpq/be-secure.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -201,9 +201,9 @@ secure_loaded_verify_locations(void)
201201
{
202202
#ifdef USE_SSL
203203
return ssl_loaded_verify_locations;
204-
#endif
205-
204+
#else
206205
return false;
206+
#endif
207207
}
208208

209209
/*

src/backend/storage/buffer/freelist.c

-3
Original file line numberDiff line numberDiff line change
@@ -233,9 +233,6 @@ StrategyGetBuffer(BufferAccessStrategy strategy, bool *lock_held)
233233
}
234234
UnlockBufHdr(buf);
235235
}
236-
237-
/* not reached */
238-
return NULL;
239236
}
240237

241238
/*

src/backend/tcop/postgres.c

-5
Original file line numberDiff line numberDiff line change
@@ -4198,11 +4198,6 @@ PostgresMain(int argc, char *argv[], const char *username)
41984198
firstchar)));
41994199
}
42004200
} /* end of input-reading loop */
4201-
4202-
/* can't get here because the above loop never exits */
4203-
Assert(false);
4204-
4205-
abort(); /* keep compiler quiet */
42064201
}
42074202

42084203

src/backend/tsearch/dict_thesaurus.c

-2
Original file line numberDiff line numberDiff line change
@@ -744,8 +744,6 @@ findVariant(LexemeInfo *in, LexemeInfo *stored, uint16 curpos, LexemeInfo **newi
744744
for (i = 0; i < newn; i++)
745745
newin[i] = newin[i]->nextentry;
746746
}
747-
748-
return NULL;
749747
}
750748

751749
static TSLexeme *

src/backend/utils/adt/formatting.c

-1
Original file line numberDiff line numberDiff line change
@@ -1439,7 +1439,6 @@ get_th(char *num, int type)
14391439
return numTH[3];
14401440
return numth[3];
14411441
}
1442-
return NULL;
14431442
}
14441443

14451444
/* ----------

src/backend/utils/adt/tsquery.c

-1
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,6 @@ gettoken_query(TSQueryParserState state,
216216
}
217217
state->buf += pg_mblen(state->buf);
218218
}
219-
return PT_END;
220219
}
221220

222221
/*

src/backend/utils/adt/tsvector_parser.c

-2
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,4 @@ gettoken_tsvector(TSVectorParseState state,
362362
/* get next char */
363363
state->prsbuf += pg_mblen(state->prsbuf);
364364
}
365-
366-
return false;
367365
}

src/bin/pg_basebackup/pg_receivexlog.c

-3
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,4 @@ main(int argc, char **argv)
435435
pg_usleep(RECONNECT_SLEEP_TIME * 1000000);
436436
}
437437
}
438-
439-
/* Never get here */
440-
exit(2);
441438
}

src/bin/psql/variables.c

-2
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,6 @@ ParseVariableBool(const char *value)
115115
psql_error("unrecognized Boolean value; assuming \"on\"\n");
116116
return true;
117117
}
118-
/* suppress compiler warning */
119-
return true;
120118
}
121119

122120

src/interfaces/ecpg/ecpglib/typename.c

-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ ecpg_type_name(enum ECPGttype typ)
6565
default:
6666
abort();
6767
}
68-
return NULL;
6968
}
7069

7170
int

src/pl/plpgsql/src/pl_exec.c

-2
Original file line numberDiff line numberDiff line change
@@ -1663,8 +1663,6 @@ exec_stmt_loop(PLpgSQL_execstate *estate, PLpgSQL_stmt_loop *stmt)
16631663
elog(ERROR, "unrecognized rc: %d", rc);
16641664
}
16651665
}
1666-
1667-
return PLPGSQL_RC_OK;
16681666
}
16691667

16701668

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/tonybelloni/postgres/commit/dd16f9480ac67ab0c6b0102d110cd5121ed9ab46

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy