Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 4b2b859

Browse files
committed
Compile and warning cleanup
1 parent d79bb2f commit 4b2b859

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+342
-228
lines changed

src/backend/bootstrap/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# Makefile for the bootstrap module
55
#
66
# IDENTIFICATION
7-
# $Header: /cvsroot/pgsql/src/backend/bootstrap/Makefile,v 1.1 1996/10/27 09:46:59 bryanh Exp $
7+
# $Header: /cvsroot/pgsql/src/backend/bootstrap/Makefile,v 1.2 1996/11/08 05:55:46 momjian Exp $
88
#
99
#
1010
# We must build bootparse.c and bootscanner.c with yacc and lex and sed,
@@ -26,7 +26,7 @@ INCLUDE_OPT = -I.. \
2626
-I../include \
2727
-I../../include
2828

29-
CFLAGS += $(INCLUDE_OPT)
29+
CFLAGS += $(INCLUDE_OPT) -Wno-error
3030

3131
BOOTYACCS = bootstrap_tokens.h bootparse.c
3232

src/backend/commands/define.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
*
1010
*
1111
* IDENTIFICATION
12-
* $Header: /cvsroot/pgsql/src/backend/commands/define.c,v 1.6 1996/11/06 08:21:34 scrappy Exp $
12+
* $Header: /cvsroot/pgsql/src/backend/commands/define.c,v 1.7 1996/11/08 05:55:49 momjian Exp $
1313
*
1414
* DESCRIPTION
1515
* The "DefineFoo" routines take the parse tree and pick out the
@@ -136,8 +136,9 @@ compute_full_attributes(const List *parameters, int32 *byte_pct_p,
136136
*/
137137
*byte_pct_p = atoi(param->val);
138138
} else if (strcasecmp(param->name, "perbyte_cpu") == 0) {
139+
count = 0;
139140
if (sscanf(param->val, "%d", perbyte_cpu_p) == 0) {
140-
for (count = 0, ptr = param->val; *ptr != '\0'; ptr++)
141+
for (ptr = param->val; *ptr != '\0'; ptr++)
141142
if (*ptr == '!') count++;
142143
}
143144
*perbyte_cpu_p = (int) pow(10.0, (double) count);

src/backend/executor/execJunk.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,16 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/executor/execJunk.c,v 1.2 1996/10/31 10:11:23 scrappy Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/executor/execJunk.c,v 1.3 1996/11/08 05:55:55 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
1414

1515
#include "postgres.h"
1616

1717
#include "utils/palloc.h"
18+
#include "access/heaptuple.h"
19+
#include "access/heapam.h"
1820
#include "executor/executor.h"
1921
#include "nodes/relation.h"
2022
#include "optimizer/tlist.h" /* for MakeTLE */

src/backend/executor/execTuples.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
*
1515
*
1616
* IDENTIFICATION
17-
* $Header: /cvsroot/pgsql/src/backend/executor/execTuples.c,v 1.2 1996/10/31 10:11:38 scrappy Exp $
17+
* $Header: /cvsroot/pgsql/src/backend/executor/execTuples.c,v 1.3 1996/11/08 05:56:01 momjian Exp $
1818
*
1919
*-------------------------------------------------------------------------
2020
*/
@@ -116,6 +116,8 @@
116116
* and the TupleTableSlot node in execnodes.h.
117117
*
118118
*/
119+
#include <string.h>
120+
119121
#include "postgres.h"
120122

121123

src/backend/executor/nodeGroup.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,15 @@
1313
* columns. (ie. tuples from the same group are consecutive)
1414
*
1515
* IDENTIFICATION
16-
* $Header: /cvsroot/pgsql/src/backend/executor/nodeGroup.c,v 1.2 1996/10/31 10:11:59 scrappy Exp $
16+
* $Header: /cvsroot/pgsql/src/backend/executor/nodeGroup.c,v 1.3 1996/11/08 05:56:08 momjian Exp $
1717
*
1818
*-------------------------------------------------------------------------
1919
*/
2020
#include "postgres.h"
2121

2222
#include "access/heapam.h"
2323
#include "catalog/catalog.h"
24+
#include "access/printtup.h"
2425
#include "executor/executor.h"
2526
#include "executor/nodeGroup.h"
2627

src/backend/executor/nodeNestloop.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/executor/nodeNestloop.c,v 1.2 1996/10/31 10:12:14 scrappy Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/executor/nodeNestloop.c,v 1.3 1996/11/08 05:56:15 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -20,6 +20,7 @@
2020
#include "postgres.h"
2121

2222
#include "executor/executor.h"
23+
#include "executor/execdebug.h"
2324
#include "executor/nodeNestloop.h"
2425
#include "executor/nodeIndexscan.h"
2526

src/backend/executor/nodeSeqscan.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/executor/nodeSeqscan.c,v 1.2 1996/10/31 10:12:20 scrappy Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/executor/nodeSeqscan.c,v 1.3 1996/11/08 05:56:16 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -25,7 +25,9 @@
2525
#include "postgres.h"
2626

2727
#include "executor/executor.h"
28+
#include "executor/execdebug.h"
2829
#include "executor/nodeSeqscan.h"
30+
#include "access/heapam.h"
2931
#include "parser/parsetree.h"
3032

3133
/* ----------------------------------------------------------------

src/backend/executor/nodeSort.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,20 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/executor/nodeSort.c,v 1.3 1996/10/31 10:12:22 scrappy Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/executor/nodeSort.c,v 1.4 1996/11/08 05:56:17 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
1414
#include "postgres.h"
1515

1616
#include "executor/executor.h"
17+
#include "executor/execdebug.h"
1718
#include "executor/nodeSort.h"
19+
#include "access/heapam.h"
1820
#include "utils/palloc.h"
1921
#include "utils/psort.h"
2022
#include "catalog/catalog.h"
23+
#include "catalog/heap.h"
2124
#include "storage/bufmgr.h"
2225
#include "optimizer/internal.h" /* for _TEMP_RELATION_ID_ */
2326

src/backend/executor/nodeUnique.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/executor/nodeUnique.c,v 1.3 1996/10/31 10:12:26 scrappy Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/executor/nodeUnique.c,v 1.4 1996/11/08 05:56:19 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -27,6 +27,8 @@
2727
#include "executor/executor.h"
2828
#include "executor/nodeUnique.h"
2929
#include "optimizer/clauses.h"
30+
#include "access/heapam.h"
31+
#include "access/heaptuple.h"
3032
#include "access/printtup.h" /* for typtoout() */
3133
#include "utils/builtins.h" /* for namecpy()*/
3234

@@ -128,6 +130,10 @@ ExecUnique(Unique *node)
128130
tupDesc = ExecGetResultType(uniquestate);
129131
typoutput = typtoout((Oid)tupDesc->attrs[uniqueAttrNum-1]->atttypid);
130132
}
133+
else { /* keep compiler quiet */
134+
tupDesc = NULL;
135+
typoutput = 0;
136+
}
131137

132138
/* ----------------
133139
* now loop, returning only non-duplicate tuples.

src/backend/libpq/pqcomm.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/libpq/pqcomm.c,v 1.5 1996/11/06 08:48:30 scrappy Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/libpq/pqcomm.c,v 1.6 1996/11/08 05:56:21 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -181,7 +181,7 @@ pq_flush()
181181
int
182182
pq_getstr(char *s, int maxlen)
183183
{
184-
int c;
184+
int c = '\0';
185185

186186
if (Pfin == (FILE *) NULL) {
187187
/* elog(DEBUG, "Input descriptor is null"); */
@@ -266,7 +266,7 @@ PQputline(char *s)
266266
int
267267
pq_getnchar(char *s, int off, int maxlen)
268268
{
269-
int c;
269+
int c = '\0';
270270

271271
if (Pfin == (FILE *) NULL) {
272272
/* elog(DEBUG, "Input descriptor is null"); */

src/backend/main/main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/main/main.c,v 1.1.1.1 1996/07/09 06:21:32 scrappy Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/main/main.c,v 1.2 1996/11/08 05:56:27 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
1414
#include <string.h>
15-
#include "c.h"
15+
#include "postgres.h"
1616
#include "miscadmin.h"
1717
#include "bootstrap/bootstrap.h" /* for BootstrapMain() */
1818
#include "tcop/tcopprot.h" /* for PostgresMain() */

src/backend/nodes/copyfuncs.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.2 1996/08/19 13:32:14 scrappy Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.3 1996/11/08 05:56:35 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -39,7 +39,7 @@ List *
3939
listCopy(List *list)
4040
{
4141
List *newlist=NIL;
42-
List *l, *nl;
42+
List *l, *nl=NIL;
4343

4444
foreach(l, list) {
4545
if (newlist==NIL) {
@@ -1653,7 +1653,7 @@ copyObject(void *from)
16531653
case T_List:
16541654
{
16551655
List *list=from, *l;
1656-
List *newlist = NIL, *nl;
1656+
List *newlist = NIL, *nl=NIL;
16571657
foreach(l, list) {
16581658
if (newlist==NIL) {
16591659
newlist = nl = lcons(copyObject(lfirst(l)),NIL);

src/backend/nodes/equalfuncs.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/nodes/equalfuncs.c,v 1.2 1996/08/26 06:30:51 scrappy Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/nodes/equalfuncs.c,v 1.3 1996/11/08 05:56:39 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -570,7 +570,7 @@ _equalValue(Value *a, Value *b)
570570
bool
571571
equal(void *a, void *b)
572572
{
573-
bool retval;
573+
bool retval=false;
574574

575575
if (a == b)
576576
return(true);

src/backend/nodes/outfuncs.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/nodes/outfuncs.c,v 1.1.1.1 1996/07/09 06:21:33 scrappy Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/nodes/outfuncs.c,v 1.2 1996/11/08 05:56:43 momjian Exp $
1111
*
1212
* NOTES
1313
* Every (plan) node in POSTGRES has an associated "out" routine which
@@ -548,7 +548,7 @@ static void
548548
_outExpr(StringInfo str, Expr *node)
549549
{
550550
char buf[500];
551-
char *opstr;
551+
char *opstr = NULL;
552552

553553
sprintf(buf, "EXPR");
554554
appendStringInfo(str,buf);

src/backend/nodes/read.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/nodes/read.c,v 1.1.1.1 1996/07/09 06:21:33 scrappy Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/nodes/read.c,v 1.2 1996/11/08 05:56:48 momjian Exp $
1212
*
1313
* HISTORY
1414
* AUTHOR DATE MAJOR EVENT
@@ -64,7 +64,7 @@ stringToNode(char *str)
6464
static NodeTag
6565
nodeTokenType(char *token, int length)
6666
{
67-
NodeTag retval;
67+
NodeTag retval = 0;
6868

6969
/*
7070
* Check if the token is a number (decimal or integer,
@@ -168,7 +168,7 @@ nodeRead(bool read_car_only)
168168
{
169169
char *token;
170170
NodeTag type;
171-
Node *this_value, *return_value;
171+
Node *this_value = NULL, *return_value = NULL;
172172
int tok_len;
173173
char tmp;
174174
bool make_dotted_pair_cell = false;

src/backend/nodes/readfuncs.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/nodes/readfuncs.c,v 1.2 1996/07/31 02:18:48 scrappy Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/nodes/readfuncs.c,v 1.3 1996/11/08 05:56:49 momjian Exp $
1111
*
1212
* NOTES
1313
* Most of the read functions for plan nodes are tested. (In fact, they
@@ -1047,7 +1047,7 @@ _readEState()
10471047
token = lsptok(NULL, &length); /* get @ */
10481048
token = lsptok(NULL, &length); /* now read it */
10491049

1050-
sscanf(token, "%x", &local_node->es_result_relation_info);
1050+
sscanf(token, "%x",(unsigned int *)&local_node->es_result_relation_info);
10511051

10521052
return(local_node);
10531053
}
@@ -1117,13 +1117,13 @@ _readRel()
11171117
token = lsptok(NULL, &length); /* get @ */
11181118
token = lsptok(NULL, &length); /* now read it */
11191119

1120-
sscanf(token, "%x", &local_node->unorderedpath);
1120+
sscanf(token, "%x", (unsigned int *)&local_node->unorderedpath);
11211121

11221122
token = lsptok(NULL, &length); /* get :cheapestpath */
11231123
token = lsptok(NULL, &length); /* get @ */
11241124
token = lsptok(NULL, &length); /* now read it */
11251125

1126-
sscanf(token, "%x", &local_node->cheapestpath);
1126+
sscanf(token, "%x", (unsigned int *)&local_node->cheapestpath);
11271127

11281128

11291129
token = lsptok(NULL, &length); /* get :clauseinfo */
@@ -1792,7 +1792,7 @@ parsePlanString()
17921792
{
17931793
char *token;
17941794
int length;
1795-
void *return_value;
1795+
void *return_value = NULL;
17961796

17971797
token = lsptok(NULL, &length);
17981798

src/backend/optimizer/path/allpaths.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/allpaths.c,v 1.2 1996/11/06 09:29:03 scrappy Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/allpaths.c,v 1.3 1996/11/08 05:56:52 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -255,7 +255,7 @@ print_path(Query *root, Path *path, int indent)
255255
{
256256
char *ptype = NULL;
257257
JoinPath *jp;
258-
bool join;
258+
bool join = false;
259259
int i;
260260

261261
for(i=0; i < indent; i++)

src/backend/optimizer/path/indxpath.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/indxpath.c,v 1.3 1996/09/10 06:48:12 scrappy Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/indxpath.c,v 1.4 1996/11/08 05:56:55 momjian Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -981,6 +981,7 @@ indexable_joinclauses(Rel *rel, Rel *index, List *joininfo_list)
981981
* the list of clause info contains join clauses and restriction clauses.
982982
* This routine returns the restriction clauses only.
983983
*/
984+
#ifdef NOT_USED
984985
static List *
985986
extract_restrict_clauses(List *clausegroup)
986987
{
@@ -996,6 +997,7 @@ extract_restrict_clauses(List *clausegroup)
996997
}
997998
return restrict_cls;
998999
}
1000+
#endif
9991001

10001002
/*
10011003
* index-innerjoin--

0 commit comments

Comments
 (0)