misc: Correct various -Wunterminated-string-initialization warnings

-Wunterminates-string-initialization will complain if we try to shove
a "string" into a fixed array that is too small.  Sometimes this is
intentional; when you are merely using "string" as a standin for
"non-terminated sequence of bytes".  In these cases we need to mark
the "string" as "not actually a string" with an attribute.  Applies to
GCC >=8, but this warning isn't pulled in by -Wextra until GCC >= 15.

Change-Id: Ib94410a22f4587940b16cf03d539fbadc3373686
This commit is contained in:
Solomon Peachy 2025-04-21 16:38:02 -04:00
parent c65050571e
commit 180753ce0a
6 changed files with 57 additions and 49 deletions

View file

@ -199,7 +199,7 @@ void init_memory (void)
static struct {
enum story story_id;
zword release;
zbyte serial[6];
zbyte serial[6] __NONSTRING;
} records[] = {
{ SHERLOCK, 21, "871214" },
{ SHERLOCK, 26, "880127" },
@ -426,7 +426,7 @@ static void free_undo (int count)
void reset_memory (void)
{
if (story_fp != -1)
if (story_fp != -1)
fclose (story_fp);
story_fp = -1;