[PATCH] frontend: mark unused WAVE_FORMAT_EXTENSIBLE fields
"Maya R. Odinezenko via Lame-dev" <[email protected]> Fri, 17 Jul 2026 15:18:57 -0400
| Newsgroups | gmane.comp.audio.mp3.lame |
|---|---|
| Message-ID | <CAFCgL3=KxLcvUqgKOwus7+0bCRrGEC8pf=ZCwG9jzOVY=Bt2vQ@mail.gmail.com> |
Hello,
A small cosmetic one. In parse_wave_header() (frontend/get_audio.c)
the three parsed-but-unused WAVE_FORMAT_EXTENSIBLE fields are marked
with a single
(void) (ui16_cbSize, ui16_wValidBitsPerSample, ui32_dwChannelMask);
but the comma operator evaluates and discards the first two operands,
so that cast silences only the last one; clang still reports
-Wunused-value on the other two. The patch marks each field with its
own (void) cast. No runtime or file-output effect; it just removes the
two remaining warnings.
The patch is against current trunk (r6597).
Maya
-- >8 --
From: Maya <[email protected]>
Date: Fri, 17 Jul 2026 14:30:00 -0400
Subject: [PATCH] frontend: mark unused WAVE_FORMAT_EXTENSIBLE fields
individually
A single (void)(a, b, c) casts only the result of the comma expression
to void; clang still diagnoses the first two operands, whose values
have no effect. Mark each of the three parsed-but-unused
WAVE_FORMAT_EXTENSIBLE fields with its own (void) cast instead.
No runtime or file-output effect; it removes the two remaining clang
diagnostics at this line.
---
frontend/get_audio.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/frontend/get_audio.c b/frontend/get_audio.c
index f492efe..9a6ceee 100644
--- a/frontend/get_audio.c
+++ b/frontend/get_audio.c
@@ -1527,7 +1527,11 @@ parse_wave_header(lame_global_flags * gfp, FILE * sf)
uint16_t ui16_SubFormat = read_16_bits_low_high(sf);
ui32_cksize -= 10u;
ui16_wFormatTag = ui16_SubFormat; /* SubType
coincident with format_tag for PCM int or float */
- (void) (ui16_cbSize, ui16_wValidBitsPerSample,
ui32_dwChannelMask); /* unused */
+ /* (void)(a, b, c) casts only the last operand; the comma
+ operator discards the earlier ones, so mark each */
+ (void) ui16_cbSize; /* unused */
+ (void) ui16_wValidBitsPerSample; /* unused */
+ (void) ui32_dwChannelMask; /* unused */
}
/* DEBUGF(" skipping %d bytes\n", ui32_cksize); */
if (ui32_cksize > 0) {