8000 Fixup warning on GCC_VERSION: 15.1.1 by kraln · Pull Request #347 · dvidelabs/flatcc · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fixup warning on GCC_VERSION: 15.1.1 #347

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kraln
Copy link
@kraln kraln commented Jun 18, 2025

On a fairly recent arch, flatcc fails to compile due to a new warning in the portable printf implementation:

In file included from /home/jeff/projects/flatcc/include/flatcc/portable/pprintfp.h:17,
                 from /home/jeff/projects/flatcc/src/runtime/json_printer.c:26:
/home/jeff/projects/flatcc/include/flatcc/portable/grisu3_print.h: In function ‘grisu3_print_nan’:
/home/jeff/projects/flatcc/include/flatcc/portable/grisu3_print.h:186:33: error: initializer-string for array of ‘char’ truncates NUL terminator but destination lacks ‘nonstring’ attribute (17 chars into 16 available) [-Werror=unterminated-string-initialization]
  186 |     static char hexdigits[16] = "0123456789ABCDEF";
      |                                 ^~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
make[2]: *** [src/runtime/CMakeFiles/flatccrt.dir/build.make:149: src/runtime/CMakeFiles/flatccrt.dir/json_printer.c.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:152: src/runtime/CMakeFiles/flatccrt.dir/all] Error 2
make: *** [Makefile:91: all] Error 2

This small attribute additional silences the warning.

Forked from 47af7e6, 6.15.2-arch1-1 x86-64 and gcc (GCC) 15.1.1 20250425.

(there's another issue with too-new cmake--cmake version 4.0.3-dirty triggers the minimum cmake version check, but the fix for that is less obvious/trivial)

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.

1 participant
0