Silence compiler warnings for unsupported compression methods.
authorTom Lane <[email protected]>
Fri, 8 Apr 2022 22:14:24 +0000 (18:14 -0400)
committerTom Lane <[email protected]>
Fri, 8 Apr 2022 22:14:24 +0000 (18:14 -0400)
wrasse, at least, moans about the lack of any "return" statement
in these functions.  You'd think pretty much everything would
know that exit(1) doesn't return, but evidently not.

src/bin/pg_basebackup/bbstreamer_gzip.c
src/bin/pg_basebackup/bbstreamer_lz4.c
src/bin/pg_basebackup/bbstreamer_zstd.c

index d5b38ec4bcd85ece6bf58428d4c8d9cbe28277ac..1ab7ee6ea91f2a949ad9b464eda81abc73962592 100644 (file)
@@ -116,6 +116,7 @@ bbstreamer_gzip_writer_new(char *pathname, FILE *file,
        return &streamer->base;
 #else
        pg_fatal("this build does not support gzip compression");
+       return NULL;                            /* keep compiler quiet */
 #endif
 }
 
@@ -248,6 +249,7 @@ bbstreamer_gzip_decompressor_new(bbstreamer *next)
        return &streamer->base;
 #else
        pg_fatal("this build does not support gzip compression");
+       return NULL;                            /* keep compiler quiet */
 #endif
 }
 
index 93f8344ea350d611608b1f369364e3ca1d08b929..2f75ba560292df9119ec9bb12d21d2888e84f7ea 100644 (file)
@@ -99,6 +99,7 @@ bbstreamer_lz4_compressor_new(bbstreamer *next, bc_specification *compress)
        return &streamer->base;
 #else
        pg_fatal("this build does not support lz4 compression");
+       return NULL;                            /* keep compiler quiet */
 #endif
 }
 
@@ -296,6 +297,7 @@ bbstreamer_lz4_decompressor_new(bbstreamer *next)
        return &streamer->base;
 #else
        pg_fatal("this build does not support lz4 compression");
+       return NULL;                            /* keep compiler quiet */
 #endif
 }
 
index e2c76503cc715d71d2d69317872050885aa95b32..a5167e9fea1331d72a29338acee965229d9106db 100644 (file)
@@ -117,6 +117,7 @@ bbstreamer_zstd_compressor_new(bbstreamer *next, bc_specification *compress)
        return &streamer->base;
 #else
        pg_fatal("this build does not support zstd compression");
+       return NULL;                            /* keep compiler quiet */
 #endif
 }
 
@@ -271,6 +272,7 @@ bbstreamer_zstd_decompressor_new(bbstreamer *next)
        return &streamer->base;
 #else
        pg_fatal("this build does not support zstd compression");
+       return NULL;                            /* keep compiler quiet */
 #endif
 }