Skip to content

Commit 71d4a97

Browse files
authored
Merge pull request #11 from postgrespro/PGPRO-5646
PGPRO-5646: remove compiler warning (gcc 11.2.0)
2 parents 3d6ccc6 + 3dbc4fa commit 71d4a97

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

Diff for: engine.c

+11-1
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,17 @@ ptrackCheckpoint(void)
394394
*
395395
* Write both magic and varsion_num at once.
396396
*/
397-
ptrack_write_chunk(ptrack_tmp_fd, &crc, (char *) &ptrack_map->magic,
397+
398+
/*
399+
* Previously we read from the field magic, now we read from the beginning
400+
* of the structure PtrackMapHdr. Make sure nothing has changed since then.
401+
*/
402+
StaticAssertStmt(
403+
offsetof(PtrackMapHdr, magic) == 0,
404+
"old write format for PtrackMapHdr.magic and PtrackMapHdr.version_num "
405+
"is not upward-compatible");
406+
407+
ptrack_write_chunk(ptrack_tmp_fd, &crc, (char *) ptrack_map,
398408
offsetof(PtrackMapHdr, init_lsn));
399409

400410
init_lsn = pg_atomic_read_u64(&ptrack_map->init_lsn);

0 commit comments

Comments
 (0)