[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#60327: [COMMITTED] maint: port to gcc -std=c99 -Wstrict-prototypes
From: |
Paul Eggert |
Subject: |
bug#60327: [COMMITTED] maint: port to gcc -std=c99 -Wstrict-prototypes |
Date: |
Sun, 25 Dec 2022 19:15:10 -0800 |
This doesn’t fix any bugs, since the code is correct as-is on all
C versions. However, it pacifies gcc -std=c99 -Wstrict-prototypes,
which complains about a function definition without arguments
unless there’s a previous prototype with ‘(void)’.
Most (but not all) of this patch merely reverts some recent
changes to be more consistent when porting to C23.
* dfltcc.c (is_dfltcc_enabled):
* gzip.c (get_input_size_and_time):
* inflate.c (inflate_stored, inflate_fixed, inflate_dynamic):
* unpack.c (read_byte):
---
dfltcc.c | 2 +-
gzip.c | 2 +-
inflate.c | 6 +++---
unpack.c | 2 +-
4 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/dfltcc.c b/dfltcc.c
index 0c14ad5..b9eaf5e 100644
--- a/dfltcc.c
+++ b/dfltcc.c
@@ -147,7 +147,7 @@ is_bit_set (const char *bits, int n)
}
static int
-is_dfltcc_enabled ()
+is_dfltcc_enabled (void)
{
char facilities[(DFLTCC_FACILITY / 64 + 1) * 8];
diff --git a/gzip.c b/gzip.c
index 5cfdb24..9602271 100644
--- a/gzip.c
+++ b/gzip.c
@@ -710,7 +710,7 @@ input_eof ()
}
static void
-get_input_size_and_time ()
+get_input_size_and_time (void)
{
ifile_size = -1;
time_stamp.tv_nsec = -1;
diff --git a/inflate.c b/inflate.c
index f90cab5..e92bc6c 100644
--- a/inflate.c
+++ b/inflate.c
@@ -627,7 +627,7 @@ inflate_codes(struct huft *tl, struct huft *td, int bl, int
bd)
/* "decompress" an inflated type 0 (stored) block. */
static int
-inflate_stored ()
+inflate_stored(void)
{
unsigned n; /* number of bytes in block */
unsigned w; /* current window position */
@@ -683,7 +683,7 @@ inflate_stored ()
either replace this with a custom decoder, or at least precompute the
Huffman tables. */
static int
-inflate_fixed ()
+inflate_fixed(void)
{
int i; /* temporary variable */
struct huft *tl; /* literal/length code table */
@@ -733,7 +733,7 @@ inflate_fixed ()
/* decompress an inflated type 2 (dynamic Huffman codes) block. */
static int
-inflate_dynamic ()
+inflate_dynamic(void)
{
int i; /* temporary variables */
unsigned j;
diff --git a/unpack.c b/unpack.c
index 39ca75d..ba7d106 100644
--- a/unpack.c
+++ b/unpack.c
@@ -78,7 +78,7 @@ static int valid; /* number of valid bits in
bitbuf */
/* Read an input byte, reporting an error at EOF. */
static unsigned char
-read_byte ()
+read_byte (void)
{
int b = get_byte ();
if (b < 0)
--
2.38.1
- bug#60326: [COMMITTED 1/8] build: update gnulib submodule to latest, Paul Eggert, 2022/12/25
- bug#60327: [COMMITTED 2/8] maint: update .gitignore to match Gnulib changes, Paul Eggert, 2022/12/25
- bug#60327: [COMMITTED] maint: port to gcc -std=c99 -Wstrict-prototypes,
Paul Eggert <=
- bug#60326: [COMMITTED 5/8] maint: stop using obsolete dosname module, Paul Eggert, 2022/12/25
- bug#60326: [COMMITTED 4/8] maint: stop using obsolete stdnoreturn module, Paul Eggert, 2022/12/25
- bug#60326: [COMMITTED 3/8] maint: stop using obsolete fdl module, Paul Eggert, 2022/12/25
- bug#60326: [COMMITTED 7/8] gzip: local → static, Paul Eggert, 2022/12/25
- bug#60326: [COMMITTED 6/8] maint: port function definitions to C23, Paul Eggert, 2022/12/25
- bug#60326: [COMMITTED 8/8] gzip: port alignas usage to C23, Paul Eggert, 2022/12/25
- bug#60326: [PATCH] maint: do not include stdbool.h, stdalign.h, Paul Eggert, 2022/12/26
- bug#60326: [PATCH 1/2] maint: link with $(LIB_FDATASYNC), Paul Eggert, 2022/12/28