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

Commit618c64f

Browse files
committed
Revert workarounds for -Wmissing-braces false positives on old GCC
We have collected several instances of a workaround for GCC bug 53119,which caused false-positive compiler warnings. This bug has long beenfixed, but was still seen on the buildfarm, most recently on lapwingwith gcc (Debian 4.7.2-5). (The GCC bug tracker mentions that a fixwas backported to 4.7.4 and 4.8.3.)That compiler no longer runs warning-free since commit6fdd5d9, sowe don't need to keep these workarounds. And furthermore, theconsensus appears to be that we don't want to keep supporting that eraof platform anymore at all.This reverts the following commits:d937904506428db449afb6392f2abad07635e0c761and makes a few similar fixes to newer code.Discussion:https://www.postgresql.org/message-id/flat/e170d61f-01ab-4cf9-ab68-91cd1fac62c5%40eisentraut.orgDiscussion:https://www.postgresql.org/message-id/flat/CA%2BTgmoYEAm-KKZibAP3hSqbTFTjUd47XtVcf3xSFDpyecXX9uQ%40mail.gmail.com
1 parentb7076c1 commit618c64f

File tree

9 files changed

+16
-25
lines changed

9 files changed

+16
-25
lines changed

‎contrib/pg_prewarm/autoprewarm.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -798,12 +798,11 @@ apw_detach_shmem(int code, Datum arg)
798798
staticvoid
799799
apw_start_leader_worker(void)
800800
{
801-
BackgroundWorkerworker;
801+
BackgroundWorkerworker= {0};
802802
BackgroundWorkerHandle*handle;
803803
BgwHandleStatusstatus;
804804
pid_tpid;
805805

806-
MemSet(&worker,0,sizeof(BackgroundWorker));
807806
worker.bgw_flags=BGWORKER_SHMEM_ACCESS;
808807
worker.bgw_start_time=BgWorkerStart_ConsistentState;
809808
strcpy(worker.bgw_library_name,"pg_prewarm");
@@ -840,10 +839,9 @@ apw_start_leader_worker(void)
840839
staticvoid
841840
apw_start_database_worker(void)
842841
{
843-
BackgroundWorkerworker;
842+
BackgroundWorkerworker= {0};
844843
BackgroundWorkerHandle*handle;
845844

846-
MemSet(&worker,0,sizeof(BackgroundWorker));
847845
worker.bgw_flags=
848846
BGWORKER_SHMEM_ACCESS |BGWORKER_BACKEND_DATABASE_CONNECTION;
849847
worker.bgw_start_time=BgWorkerStart_ConsistentState;

‎contrib/postgres_fdw/postgres_fdw.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3333,7 +3333,7 @@ estimate_path_cost_size(PlannerInfo *root,
33333333
{
33343334
RelOptInfo*outerrel=fpinfo->outerrel;
33353335
PgFdwRelationInfo*ofpinfo;
3336-
AggClauseCostsaggcosts;
3336+
AggClauseCostsaggcosts= {0};
33373337
doubleinput_rows;
33383338
intnumGroupCols;
33393339
doublenumGroups=1;
@@ -3357,7 +3357,6 @@ estimate_path_cost_size(PlannerInfo *root,
33573357
input_rows=ofpinfo->rows;
33583358

33593359
/* Collect statistics about aggregates for estimating costs. */
3360-
MemSet(&aggcosts,0,sizeof(AggClauseCosts));
33613360
if (root->parse->hasAggs)
33623361
{
33633362
get_agg_clause_costs(root,AGGSPLIT_SIMPLE,&aggcosts);

‎src/backend/optimizer/path/costsize.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2690,13 +2690,12 @@ cost_agg(Path *path, PlannerInfo *root,
26902690
doubleoutput_tuples;
26912691
Coststartup_cost;
26922692
Costtotal_cost;
2693-
AggClauseCostsdummy_aggcosts;
2693+
constAggClauseCostsdummy_aggcosts= {0};
26942694

26952695
/* Use all-zero per-aggregate costs if NULL is passed */
26962696
if (aggcosts==NULL)
26972697
{
26982698
Assert(aggstrategy==AGG_HASHED);
2699-
MemSet(&dummy_aggcosts,0,sizeof(AggClauseCosts));
27002699
aggcosts=&dummy_aggcosts;
27012700
}
27022701

‎src/backend/storage/smgr/bulk_write.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646

4747
#defineMAX_PENDING_WRITES XLR_MAX_BLOCK_ID
4848

49-
staticconstPGIOAlignedBlockzero_buffer= {{0}};/* worth BLCKSZ */
49+
staticconstPGIOAlignedBlockzero_buffer= {0};/* worth BLCKSZ */
5050

5151
typedefstructPendingWrite
5252
{

‎src/bin/pg_waldump/rmgrdesc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ static const RmgrDescData RmgrDescTable[RM_N_BUILTIN_IDS] = {
4141

4242
#defineCUSTOM_NUMERIC_NAME_LEN sizeof("custom###")
4343

44-
staticcharCustomNumericNames[RM_N_CUSTOM_IDS][CUSTOM_NUMERIC_NAME_LEN]= {{0}};
45-
staticRmgrDescDataCustomRmgrDesc[RM_N_CUSTOM_IDS]= {{0}};
44+
staticcharCustomNumericNames[RM_N_CUSTOM_IDS][CUSTOM_NUMERIC_NAME_LEN]= {0};
45+
staticRmgrDescDataCustomRmgrDesc[RM_N_CUSTOM_IDS]= {0};
4646
staticboolCustomRmgrDescInitialized= false;
4747

4848
/*

‎src/bin/pgbench/pgbench.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2279,15 +2279,10 @@ evalStandardFunc(CState *st,
22792279
{
22802280
/* evaluate all function arguments */
22812281
intnargs=0;
2282+
PgBenchValuevargs[MAX_FARGS]= {0};
22822283
PgBenchExprLink*l=args;
22832284
boolhas_null= false;
22842285

2285-
/*
2286-
* This value is double braced to workaround GCC bug 53119, which seems to
2287-
* exist at least on gcc (Debian 4.7.2-5) 4.7.2, 32-bit.
2288-
*/
2289-
PgBenchValuevargs[MAX_FARGS]= {{0}};
2290-
22912286
for (nargs=0;nargs<MAX_FARGS&&l!=NULL;nargs++,l=l->next)
22922287
{
22932288
if (!evaluateExpr(st,l->expr,&vargs[nargs]))

‎src/common/blkreftable.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ BlockRefTableSetLimitBlock(BlockRefTable *brtab,
265265
BlockNumberlimit_block)
266266
{
267267
BlockRefTableEntry*brtentry;
268-
BlockRefTableKeykey= {{0}};/* make sure any padding is zero */
268+
BlockRefTableKeykey= {0};/* make sure any padding is zero */
269269
boolfound;
270270

271271
memcpy(&key.rlocator,rlocator,sizeof(RelFileLocator));
@@ -300,7 +300,7 @@ BlockRefTableMarkBlockModified(BlockRefTable *brtab,
300300
BlockNumberblknum)
301301
{
302302
BlockRefTableEntry*brtentry;
303-
BlockRefTableKeykey= {{0}};/* make sure any padding is zero */
303+
BlockRefTableKeykey= {0};/* make sure any padding is zero */
304304
boolfound;
305305
#ifndefFRONTEND
306306
MemoryContextoldcontext=MemoryContextSwitchTo(brtab->mcxt);
@@ -340,7 +340,7 @@ BlockRefTableEntry *
340340
BlockRefTableGetEntry(BlockRefTable*brtab,constRelFileLocator*rlocator,
341341
ForkNumberforknum,BlockNumber*limit_block)
342342
{
343-
BlockRefTableKeykey= {{0}};/* make sure any padding is zero */
343+
BlockRefTableKeykey= {0};/* make sure any padding is zero */
344344
BlockRefTableEntry*entry;
345345

346346
Assert(limit_block!=NULL);
@@ -521,7 +521,7 @@ WriteBlockRefTable(BlockRefTable *brtab,
521521
for (i=0;i<brtab->hash->members;++i)
522522
{
523523
BlockRefTableSerializedEntry*sentry=&sdata[i];
524-
BlockRefTableKeykey= {{0}};/* make sure any padding is zero */
524+
BlockRefTableKeykey= {0};/* make sure any padding is zero */
525525
unsignedj;
526526

527527
/* Write the serialized entry itself. */
@@ -616,7 +616,7 @@ BlockRefTableReaderNextRelation(BlockRefTableReader *reader,
616616
BlockNumber*limit_block)
617617
{
618618
BlockRefTableSerializedEntrysentry;
619-
BlockRefTableSerializedEntryzentry= {{0}};
619+
BlockRefTableSerializedEntryzentry= {0};
620620

621621
/*
622622
* Sanity check: caller must read all blocks from all chunks before moving
@@ -1291,7 +1291,7 @@ BlockRefTableWrite(BlockRefTableBuffer *buffer, void *data, int length)
12911291
staticvoid
12921292
BlockRefTableFileTerminate(BlockRefTableBuffer*buffer)
12931293
{
1294-
BlockRefTableSerializedEntryzentry= {{0}};
1294+
BlockRefTableSerializedEntryzentry= {0};
12951295
pg_crc32ccrc;
12961296

12971297
/* Write a sentinel indicating that there are no more entries. */

‎src/common/file_utils.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -687,7 +687,7 @@ pg_pwritev_with_retry(int fd, const struct iovec *iov, int iovcnt, off_t offset)
687687
ssize_t
688688
pg_pwrite_zeros(intfd,size_tsize,off_toffset)
689689
{
690-
staticconstPGIOAlignedBlockzbuffer= {{0}};/* worth BLCKSZ */
690+
staticconstPGIOAlignedBlockzbuffer= {0};/* worth BLCKSZ */
691691
void*zerobuf_addr=unconstify(PGIOAlignedBlock*,&zbuffer)->data;
692692
structioveciov[PG_IOV_MAX];
693693
size_tremaining_size=size;

‎src/interfaces/libpq/fe-auth-oauth-curl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1232,7 +1232,7 @@ register_socket(CURL *curl, curl_socket_t socket, int what, void *ctx,
12321232
#endif
12331233
#ifdefHAVE_SYS_EVENT_H
12341234
structasync_ctx*actx=ctx;
1235-
structkeventev[2]= {{0}};
1235+
structkeventev[2]= {0};
12361236
structkeventev_out[2];
12371237
structtimespectimeout= {0};
12381238
intnev=0;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp