Kaydet (Commit) 44238adb authored tarafından Stephan Bergmann's avatar Stephan Bergmann

GCC trunk towards GCC 9 still emits a bogus -Wstringop-truncation

Change-Id: I1e9e439558025030f79e070680831f1139675993
Reviewed-on: https://gerrit.libreoffice.org/66869
Tested-by: Jenkins
Reviewed-by: 's avatarStephan Bergmann <sbergman@redhat.com>
üst 9a7aa332
......@@ -67,14 +67,14 @@ void HWPStyle::SetName(int n, char const *name)
{
if (name)
{
#if defined __GNUC__ && __GNUC__ == 8 && (__GNUC_MINOR__ == 2 || __GNUC_MINOR__ == 3) && !defined __clang__
#if defined __GNUC__ && (__GNUC__ == 8 || __GNUC__ == 9) && !defined __clang__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wstringop-truncation"
#endif
auto const p = DATA[n].name;
strncpy(p, name, MAXSTYLENAME);
p[MAXSTYLENAME] = '\0'; // just in case, even though the array is zero-initialized
#if defined __GNUC__ && __GNUC__ == 8 && (__GNUC_MINOR__ == 2 || __GNUC_MINOR__ == 3) && !defined __clang__
#if defined __GNUC__ && (__GNUC__ == 8 || __GNUC__ == 9) && !defined __clang__
#pragma GCC diagnostic pop
#endif
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment