From 16c196e0c3a694f113d44dd73c63b4e0456910e0 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Thu, 22 Aug 2024 15:45:41 -0600 Subject: [PATCH] Fix warnings with -fstrict-flex-arrays=2 Unfortunatley we cannot set it to 2 in hb.hh; but fix the warning and add it with default value of 1 anyway. Fixes https://github.com/harfbuzz/harfbuzz/pull/4836 --- src/hb-open-type.hh | 2 +- src/hb.hh | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/hb-open-type.hh b/src/hb-open-type.hh index 642332cb9..6b3a4612a 100644 --- a/src/hb-open-type.hh +++ b/src/hb-open-type.hh @@ -209,7 +209,7 @@ struct HBUINT32VAR } protected: - unsigned char v[1]; + unsigned char v[5]; public: DEFINE_SIZE_MIN (1); diff --git a/src/hb.hh b/src/hb.hh index 0ceeb99f5..fe466fe1f 100644 --- a/src/hb.hh +++ b/src/hb.hh @@ -84,6 +84,7 @@ #pragma GCC diagnostic error "-Wredundant-decls" #pragma GCC diagnostic error "-Wreorder" #pragma GCC diagnostic error "-Wsign-compare" +#pragma GCC diagnostic error "-Wstrict-flex-arrays" #pragma GCC diagnostic error "-Wstrict-prototypes" #pragma GCC diagnostic error "-Wstring-conversion" #pragma GCC diagnostic error "-Wswitch-enum"