Skip to content

Commit cebe615

Browse files
jahutchiFlole998
authored andcommitted
wizard: increase buffer size to silence -Wformat-truncation on GCC 15
GCC 15.1 introduces stricter checks around `snprintf`-like functions under `-Wformat-truncation`, even when the format string itself is under developer control. This triggers a false positive in `hello_changed()` when building with `-Werror=format-truncation`: error: ‘__builtin___snprintf_chk’ output may be truncated before the last format character [-Werror=format-truncation=] note: output between 1 and 33 bytes into a destination of size 32 This warning is triggered due to a theoretical edge case in `tvh_strlcatf()` where combining strings like `"en,fr,de"` could approach the buffer limit of 32 bytes. While truncation is unlikely in practice, the warning is still emitted aggressively by the new FORTIFY logic. Increase the buffer from 32 to 64 bytes to silence the warning and ensure headroom. This avoids having to disable the diagnostic, while still keeping the logic and usage intact. This is a defensive fix with no behavioral change, and aligns with similar mitigations used in other projects facing the same issue with GCC >= 13 and especially 15+. Tested with GCC 15.1.1, built cleanly. Refs: - https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108231 - https://gcc.gnu.org/onlinedocs/gcc-15.1.0/gcc/Warning-Options.html#index-Wformat-truncation
1 parent df4eaf8 commit cebe615

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/wizard.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ static void hello_changed(idnode_t *in)
145145
{
146146
wizard_page_t *p = (wizard_page_t *)in;
147147
wizard_hello_t *w = p->aux;
148-
char buf[32];
148+
char buf[64];
149149
size_t l = 0;
150150
int save = 0;
151151

0 commit comments

Comments
 (0)