{"action":"opened","issue":{"url":"https://api.github.com/repos/chocolate-doom/chocolate-doom/issues/1031","repository_url":"https://api.github.com/repos/chocolate-doom/chocolate-doom","labels_url":"https://api.github.com/repos/chocolate-doom/chocolate-doom/issues/1031/labels{/name}","comments_url":"https://api.github.com/repos/chocolate-doom/chocolate-doom/issues/1031/comments","events_url":"https://api.github.com/repos/chocolate-doom/chocolate-doom/issues/1031/events","html_url":"https://github.com/chocolate-doom/chocolate-doom/issues/1031","id":319851524,"number":1031,"title":"New warning with GCC 8.1","user":{"login":"turol","id":805057,"avatar_url":"https://avatars0.githubusercontent.com/u/805057?v=4","gravatar_id":"","url":"https://api.github.com/users/turol","html_url":"https://github.com/turol","followers_url":"https://api.github.com/users/turol/followers","following_url":"https://api.github.com/users/turol/following{/other_user}","gists_url":"https://api.github.com/users/turol/gists{/gist_id}","starred_url":"https://api.github.com/users/turol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/turol/subscriptions","organizations_url":"https://api.github.com/users/turol/orgs","repos_url":"https://api.github.com/users/turol/repos","events_url":"https://api.github.com/users/turol/events{/privacy}","received_events_url":"https://api.github.com/users/turol/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-05-03T09:43:03Z","updated_at":"2018-05-03T09:43:03Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"### Background\r\n\r\nVersion of Chocolate Doom: git master\r\n\r\nOperating System and version: Linux with GCC 8.1\r\n\r\nNew and shiny compiler, new and shiny warning:\r\n```\r\nsrc/w_merge.c: In function ‘FindSpriteFrame’:\r\nsrc/w_merge.c:219:5: error: ‘strncpy’ specified bound 4 equals destination size [-Werror=stringop-truncation]\r\n     strncpy(result->sprname, name, 4);\r\n```\r\nhttps://github.com/chocolate-doom/chocolate-doom/blob/00311e89f5bc707c333c38b5f1850d2f2a35e076/src/w_merge.c#L219\r\n\r\nThere are several ways to fix this:\r\n1. Detect the new compiler and disable the warning. Not recommended because this warning might catch some real bugs in the future.\r\n2. Ask the GCC folks if there's some way to tweak the code to make the compiler shut up. Not recommended because it's fragile and might break again in the future.\r\n3. Bump the size of `sprname` to 5. This fixes the warning and based on quick testing doesn't break anything.\r\n\r\nWhich do we want?"}}
{"actor":{"display_login":"turol"}}