summaryrefslogtreecommitdiff
path: root/regparse.c
diff options
context:
space:
mode:
authorYusuke Endoh <mame@ruby-lang.org>2022-06-13 15:47:19 +0900
committerYusuke Endoh <mame@ruby-lang.org>2022-06-21 11:32:02 +0900
commitf44547c99913093b397e15a0240b7bce3f7c53ca (patch)
treeba9237208ba579173abdfa4038da200b72889798 /regparse.c
parenta343952d195a324dd4563318d8f88b167316ce5d (diff)
downloadruby-f44547c99913093b397e15a0240b7bce3f7c53ca.tar.gz
regparse.c: Suppress false-positive warnings of GCC 12.1
http://rubyci.s3.amazonaws.com/arch/ruby-master/log/20220613T030003Z.log.html.gz ``` regparse.c:264:15: warning: array subscript 56 is outside array bounds of ‘Node[1]’ {aka ‘struct _Node[1]’} [-Warray-bounds] ``` and ``` /usr/include/bits/string_fortified.h:29:10: warning: ‘__builtin_memcpy’ pointer overflow between offset 32 and size [9223372036854775792, 9223372036854775807] [-Warray-bounds] ```
Diffstat (limited to 'regparse.c')
-rw-r--r--regparse.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/regparse.c b/regparse.c
index 3348381e23..309749033d 100644
--- a/regparse.c
+++ b/regparse.c
@@ -28,6 +28,13 @@
* SUCH DAMAGE.
*/
+// Suppress some false-positive compiler warnings
+#if defined(__GNUC__) && __GNUC__ >= 12
+#pragma GCC diagnostic ignored "-Warray-bounds"
+#pragma GCC diagnostic ignored "-Wstringop-overflow"
+#pragma GCC diagnostic ignored "-Wrestrict"
+#endif
+
#include "regparse.h"
#include <stdarg.h>