[前][次][番号順一覧][スレッド一覧]

ruby-changes:53374

From: shyouhei <ko1@a...>
Date: Wed, 7 Nov 2018 13:56:32 +0900 (JST)
Subject: [ruby-changes:53374] shyouhei:r65590 (trunk): suppress GCC warning about unknown sanitizers

shyouhei	2018-11-07 13:56:24 +0900 (Wed, 07 Nov 2018)

  New Revision: 65590

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=65590

  Log:
    suppress GCC warning about unknown sanitizers
    
    See also: https://travis-ci.org/ruby/ruby/jobs/451710726#L1941

  Modified files:
    trunk/gc.c
    trunk/internal.h
Index: internal.h
===================================================================
--- internal.h	(revision 65589)
+++ internal.h	(revision 65590)
@@ -68,6 +68,16 @@ extern "C" { https://github.com/ruby/ruby/blob/trunk/internal.h#L68
 # define ATTRIBUTE_NO_ADDRESS_SAFETY_ANALYSIS(x) x
 #endif
 
+#if defined(NO_SANITIZE) && defined(__GNUC__) &&! defined(__clang__)
+/* GCC warns about unknown sanitizer, which is annoying. */
+#undef NO_SANITIZE
+#define NO_SANITIZE(x, y) \
+    COMPILER_WARNING_PUSH; \
+    COMPILER_WARNING_IGNORED(-Wattributes); \
+    __attribute__((__no_sanitize__(x))) y; \
+    COMPILER_WARNING_POP
+#endif
+
 #ifndef NO_SANITIZE
 # define NO_SANITIZE(x, y) y
 #endif
Index: gc.c
===================================================================
--- gc.c	(revision 65589)
+++ gc.c	(revision 65590)
@@ -4164,11 +4164,9 @@ ruby_stack_check(void) https://github.com/ruby/ruby/blob/trunk/gc.c#L4164
     return stack_check(GET_EC(), STACKFRAME_FOR_CALL_CFUNC);
 }
 
-ATTRIBUTE_NO_ADDRESS_SAFETY_ANALYSIS
-(
+ATTRIBUTE_NO_ADDRESS_SAFETY_ANALYSIS(static void mark_locations_array(rb_objspace_t *objspace, register const VALUE *x, register long n));
 static void
 mark_locations_array(rb_objspace_t *objspace, register const VALUE *x, register long n)
-)
 {
     VALUE v;
     while (n--) {

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]