Skip to content

grisu3: make hexdigits size explicit for GCC 15#373

Merged
mikkelfj merged 1 commit into
dvidelabs:masterfrom
itsMarco-G:fix-gcc15-hexdigits-size
Apr 11, 2026
Merged

grisu3: make hexdigits size explicit for GCC 15#373
mikkelfj merged 1 commit into
dvidelabs:masterfrom
itsMarco-G:fix-gcc15-hexdigits-size

Conversation

@itsMarco-G

Copy link
Copy Markdown
Contributor

GCC 15 emits -Wunterminated-string-initialization for the hexdigits declaration in grisu3. In toolchains where warnings are treated as errors, this results in a build failure. This is reproducible in Zephyr and Executorch environments using GCC 15.

The literal contains 16 characters plus the terminating \0. Making the array size explicit avoids the diagnostic and makes the storage unambiguous:

static char hexdigits[17] = "0123456789ABCDEF";

This change:
• Explicitly accounts for the null terminator
• Resolves GCC 15 build failures when -Werror is enabled
• Introduces no functional change

Tested with GCC 15 in Zephyr based and Executorch based builds.

itsMarco-G referenced this pull request Feb 24, 2026
GCC15 started issuing a warning for non-null terminated string initiaziotions (`unterminated-string-initialization`).  
Avoiding the error by letting the compiler append the NULL
@mikkelfj mikkelfj merged commit 0d0e18e into dvidelabs:master Apr 11, 2026
5 checks passed
@mikkelfj

mikkelfj commented Apr 11, 2026

Copy link
Copy Markdown
Contributor

Thanks, this really shouldn't be necessary, but no harm done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants