From b773b61b8c1ef6bdea4452d3e558dd3fedbb93a8 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Thu, 8 Aug 2019 22:31:18 -0400 Subject: [PATCH] Revert "Try to compile with AppVeyor's GCC 9.1.0" This reverts commit 749c2753e464f9628e68c8a2bca65acbdaa202d5. --- src/Makefile.cfg | 6 ------ src/d_clisrv.c | 2 +- src/dehacked.c | 8 ++++---- src/hu_stuff.c | 2 +- src/p_spec.c | 2 +- src/v_video.c | 2 +- 6 files changed, 8 insertions(+), 14 deletions(-) diff --git a/src/Makefile.cfg b/src/Makefile.cfg index d9fee7559..738b05330 100644 --- a/src/Makefile.cfg +++ b/src/Makefile.cfg @@ -154,9 +154,6 @@ ifdef GCC43 endif endif WFLAGS+=-Wsign-compare -ifdef GCC91 - WFLAGS+=-Wno-error=address-of-packed-member -endif ifdef GCC45 WFLAGS+=-Wlogical-op endif @@ -241,9 +238,6 @@ ifdef GCC80 WFLAGS+=-Wno-error=format-overflow WFLAGS+=-Wno-error=stringop-truncation WFLAGS+=-Wno-error=stringop-overflow -ifdef GCC91 - WFLAGS+=-Werror=-Wstringop-overflow=2 -endif WFLAGS+=-Wno-format-overflow WFLAGS+=-Wno-stringop-truncation WFLAGS+=-Wno-stringop-overflow diff --git a/src/d_clisrv.c b/src/d_clisrv.c index 6c5b56f81..274fe398a 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -1242,7 +1242,7 @@ static void SV_SendServerInfo(INT32 node, tic_t servertime) netbuffer->u.serverinfo.cheatsenabled = CV_CheatsEnabled(); netbuffer->u.serverinfo.isdedicated = (UINT8)dedicated; strncpy(netbuffer->u.serverinfo.servername, cv_servername.string, - MAXSERVERNAME-1); + MAXSERVERNAME); strncpy(netbuffer->u.serverinfo.mapname, G_BuildMapName(gamemap), 7); M_Memcpy(netbuffer->u.serverinfo.mapmd5, mapmd5, 16); diff --git a/src/dehacked.c b/src/dehacked.c index d506ef910..bda0c38f7 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -1186,9 +1186,9 @@ static void readlevelheader(MYFILE *f, INT32 num) { i = get_mus(word2, true); if (i && i <= 1035) - snprintf(mapheaderinfo[num-1]->musname, 6, "%sM", G_BuildMapName(i)); + snprintf(mapheaderinfo[num-1]->musname, 7, "%sM", G_BuildMapName(i)); else if (i && i <= 1050) - strncpy(mapheaderinfo[num-1]->musname, compat_special_music_slots[i - 1036], 6); + strncpy(mapheaderinfo[num-1]->musname, compat_special_music_slots[i - 1036], 7); else mapheaderinfo[num-1]->musname[0] = 0; // becomes empty string mapheaderinfo[num-1]->musname[6] = 0; @@ -1213,7 +1213,7 @@ static void readlevelheader(MYFILE *f, INT32 num) else if (fastcmp(word, "SKYNUM")) mapheaderinfo[num-1]->skynum = (INT16)i; else if (fastcmp(word, "INTERSCREEN")) - strncpy(mapheaderinfo[num-1]->interscreen, word2, 7); + strncpy(mapheaderinfo[num-1]->interscreen, word2, 8); else if (fastcmp(word, "PRECUTSCENENUM")) mapheaderinfo[num-1]->precutscenenum = (UINT8)i; else if (fastcmp(word, "CUTSCENENUM")) @@ -3101,7 +3101,7 @@ static void readmaincfg(MYFILE *f) // Also save a time attack folder filenamelen = strlen(gamedatafilename)-4; // Strip off the extension - strncpy(timeattackfolder, gamedatafilename, min(filenamelen, sizeof (timeattackfolder)-1)); + strncpy(timeattackfolder, gamedatafilename, min(filenamelen, sizeof (timeattackfolder))); timeattackfolder[min(filenamelen, sizeof (timeattackfolder) - 1)] = '\0'; strcpy(savegamename, timeattackfolder); diff --git a/src/hu_stuff.c b/src/hu_stuff.c index 13272a748..a9a2b7504 100644 --- a/src/hu_stuff.c +++ b/src/hu_stuff.c @@ -3072,7 +3072,7 @@ void HU_DoCEcho(const char *msg) { I_OutputMsg("%s\n", msg); // print to log - strncpy(cechotext, msg, sizeof(cechotext)-1); + strncpy(cechotext, msg, sizeof(cechotext)); strncat(cechotext, "\\", sizeof(cechotext) - strlen(cechotext) - 1); cechotext[sizeof(cechotext) - 1] = '\0'; cechotimer = cechoduration; diff --git a/src/p_spec.c b/src/p_spec.c index 9b46d4b3b..f3be86ee1 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -469,7 +469,7 @@ void P_ParseAnimationDefintion(SINT8 istexture) // Increase the size to make room for the new animation definition maxanims++; animdefs = (animdef_t *)Z_Realloc(animdefs, sizeof(animdef_t)*(maxanims + 1), PU_STATIC, NULL); - strncpy(animdefs[i].startname, animdefsToken, 8); + strncpy(animdefs[i].startname, animdefsToken, 9); } // animdefs[i].startname is now set to animdefsToken either way. diff --git a/src/v_video.c b/src/v_video.c index 5f16bd916..c3b29e157 100644 --- a/src/v_video.c +++ b/src/v_video.c @@ -196,7 +196,7 @@ static void LoadPalette(const char *lumpname) const char *R_GetPalname(UINT16 num) { static char palname[9]; - char newpal[9] = "PLAYPAL\0"; + char newpal[9] = "PLAYPAL"; if (num > 0 && num <= 10000) snprintf(newpal, 8, "PAL%04u", num-1);