public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
* -Wunterminated-string-initialization warning with GCC 15 in object-file.c
@ 2024-11-17  2:50 Sam James
  2024-11-17  9:03 ` Jeff King
  0 siblings, 1 reply; 25+ messages in thread
From: Sam James @ 2024-11-17  2:50 UTC (permalink / raw)
  To: git

With upcoming GCC 15, a new warning is added
(-Wunterminated-string-initialization) that fires when building git:
```
    CC object-file.o
object-file.c:52:9: warning: initializer-string for array of ‘unsigned char’ is too long [-Wunterminated-string-initialization]
   52 |         "\x6e\xf1\x9b\x41\x22\x5c\x53\x69\xf1\xc1" \
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
object-file.c:79:17: note: in expansion of macro ‘EMPTY_TREE_SHA256_BIN_LITERAL’
   79 |         .hash = EMPTY_TREE_SHA256_BIN_LITERAL,
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
object-file.c:61:9: warning: initializer-string for array of ‘unsigned char’ is too long [-Wunterminated-string-initialization]
   61 |         "\x47\x3a\x0f\x4c\x3b\xe8\xa9\x36\x81\xa2" \
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
object-file.c:83:17: note: in expansion of macro ‘EMPTY_BLOB_SHA256_BIN_LITERAL’
   83 |         .hash = EMPTY_BLOB_SHA256_BIN_LITERAL,
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```

Context for the new warning is at https://gcc.gnu.org/PR115185.

thanks,
sam

^ permalink raw reply	[flat|nested] 25+ messages in thread

end of thread, other threads:[~2024-11-18 12:50 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-17  2:50 -Wunterminated-string-initialization warning with GCC 15 in object-file.c Sam James
2024-11-17  9:03 ` Jeff King
2024-11-17  9:08   ` [PATCH 1/5] object-file: prefer array-of-bytes initializer for hash literals Jeff King
2024-11-17  9:52     ` René Scharfe
2024-11-18  9:06       ` Jeff King
2024-11-17  9:08   ` [PATCH 2/5] object-file: drop confusing oid initializer of empty_tree struct Jeff King
2024-11-17  9:08   ` [PATCH 3/5] object-file: move empty_tree struct into find_cached_object() Jeff King
2024-11-18  7:40     ` Patrick Steinhardt
2024-11-18  9:17       ` Jeff King
2024-11-17  9:10   ` [PATCH 4/5] object-file: drop oid field from find_cached_object() return value Jeff King
2024-11-17  9:14   ` [PATCH 5/5] object-file: inline empty tree and blob literals Jeff King
2024-11-18  7:40     ` Patrick Steinhardt
2024-11-17 16:03   ` -Wunterminated-string-initialization warning with GCC 15 in object-file.c brian m. carlson
2024-11-18  9:19     ` Jeff King
2024-11-18  9:58       ` Sam James
2024-11-18  7:40   ` Patrick Steinhardt
2024-11-18  9:54   ` [PATCH 0/6] -Wunterminated-string-initialization warning + cleanups Jeff King
2024-11-18  9:54     ` [PATCH 1/6] object-file: prefer array-of-bytes initializer for hash literals Jeff King
2024-11-18  9:55     ` [PATCH 2/6] object-file: drop confusing oid initializer of empty_tree struct Jeff King
2024-11-18  9:55     ` [PATCH 3/6] object-file: move empty_tree struct into find_cached_object() Jeff King
2024-11-18  9:55     ` [PATCH 4/6] object-file: drop oid field from find_cached_object() return value Jeff King
2024-11-18  9:55     ` [PATCH 5/6] object-file: treat cached_object values as const Jeff King
2024-11-18  9:55     ` [PATCH 6/6] object-file: inline empty tree and blob literals Jeff King
2024-11-18 10:51     ` [PATCH 0/6] -Wunterminated-string-initialization warning + cleanups Patrick Steinhardt
2024-11-18 12:49       ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox