Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit9fb9691

Browse files
committed
Suppress various new compiler warnings.
Compilers that don't understand that elog(ERROR) doesn't returnissued warnings here. In the cases in libpq_pipeline.c, we werenot exactly helping things by failing to mark pg_fatal() as noreturn.Per buildfarm.
1 parent96ae658 commit9fb9691

File tree

4 files changed

+10
-2
lines changed

4 files changed

+10
-2
lines changed

‎src/backend/access/common/detoast.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -487,6 +487,7 @@ toast_decompress_datum(struct varlena *attr)
487487
returnlz4_decompress_datum(attr);
488488
default:
489489
elog(ERROR,"invalid compression method id %d",cmid);
490+
returnNULL;/* keep compiler quiet */
490491
}
491492
}
492493

@@ -518,6 +519,7 @@ toast_decompress_datum_slice(struct varlena *attr, int32 slicelength)
518519
returnlz4_decompress_datum_slice(attr,slicelength);
519520
default:
520521
elog(ERROR,"invalid compression method id %d",cmid);
522+
returnNULL;/* keep compiler quiet */
521523
}
522524
}
523525

‎src/backend/access/common/toast_compression.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ lz4_compress_datum(const struct varlena *value)
135135
{
136136
#ifndefUSE_LZ4
137137
NO_LZ4_SUPPORT();
138+
returnNULL;/* keep compiler quiet */
138139
#else
139140
int32valsize;
140141
int32len;
@@ -177,6 +178,7 @@ lz4_decompress_datum(const struct varlena *value)
177178
{
178179
#ifndefUSE_LZ4
179180
NO_LZ4_SUPPORT();
181+
returnNULL;/* keep compiler quiet */
180182
#else
181183
int32rawsize;
182184
structvarlena*result;
@@ -209,6 +211,7 @@ lz4_decompress_datum_slice(const struct varlena *value, int32 slicelength)
209211
{
210212
#ifndefUSE_LZ4
211213
NO_LZ4_SUPPORT();
214+
returnNULL;/* keep compiler quiet */
212215
#else
213216
int32rawsize;
214217
structvarlena*result;

‎src/include/access/toast_compression.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ GetCompressionMethodName(char method)
6969
return"lz4";
7070
default:
7171
elog(ERROR,"invalid compression method %c",method);
72+
returnNULL;/* keep compiler quiet */
7273
}
7374
}
7475

‎src/test/modules/libpq_pipeline/libpq_pipeline.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ exit_nicely(PGconn *conn)
6060
*/
6161
#definepg_fatal(...) pg_fatal_impl(__LINE__, __VA_ARGS__)
6262
staticvoid
63+
pg_attribute_noreturn()
6364
pg_fatal_impl(intline,constchar*fmt,...)
6465
{
6566
va_listargs;
@@ -570,6 +571,7 @@ test_pipelined_insert(PGconn *conn, int n_rows)
570571

571572
default:
572573
pg_fatal("invalid state");
574+
sql=NULL;/* keep compiler quiet */
573575
}
574576

575577
pg_debug("sending: %s\n",sql);
@@ -679,8 +681,8 @@ test_pipelined_insert(PGconn *conn, int n_rows)
679681
break;
680682
caseBI_DONE:
681683
/* unreachable */
682-
description="";
683-
abort();
684+
pg_fatal("unreachable state");
685+
cmdtag=NULL;/* keep compiler quiet */
684686
}
685687

686688
if (PQresultStatus(res)!=status)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp