Fix C error reported by Oracle compiler.
authorThomas Munro <[email protected]>
Wed, 8 Jan 2025 03:54:45 +0000 (16:54 +1300)
committerThomas Munro <[email protected]>
Wed, 8 Jan 2025 04:14:15 +0000 (17:14 +1300)
Commit 66aaabe7 (branches 13 - 17 only) was not acceptable to the Oracle
Developer Studio compiler on build farm animal wrasse.  It accidentally
used a C++ style return statement to wrap a void function.  None of the
usual compilers complained, but it is right, that is not allowed in C.
Fix.

Reported-by: Michael Paquier <[email protected]>
Discussion: https://postgr.es/m/Z33vgfVgvOnbFLN9%40paquier.xyz

src/backend/storage/smgr/smgr.c

index d33db9c4b383483a3b2a87e154752ad6657b7e6d..f01ba06b302d8bcfce8d01bcd0db6c232c8e268f 100644 (file)
@@ -557,7 +557,7 @@ smgrtruncate(SMgrRelation reln, ForkNumber *forknum, int nforks,
    for (int i = 0; i < nforks; ++i)
        old_nblocks[i] = smgrnblocks(reln, forknum[i]);
 
-   return smgrtruncate2(reln, forknum, nforks, old_nblocks, nblocks);
+   smgrtruncate2(reln, forknum, nforks, old_nblocks, nblocks);
 }
 
 /*