]> granicus.if.org Git - gc/commitdiff
Workaround 'address of auto-variable returned' cppcheck error
authorIvan Maidanski <ivmai@mail.ru>
Tue, 30 Jan 2018 08:11:45 +0000 (11:11 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Fri, 2 Mar 2018 16:51:00 +0000 (19:51 +0300)
(back-port of commit b51bdee1 from 'master')

* mark_rts.c [CPPCHECK] (GC_approx_sp): Use __builtin_frame_address.

mark_rts.c

index 650b7d0e399de5d1bf52bc18d36a3209c6e9e6b5..377774874f45e1309e933b40f6b3967ad49ac7da 100644 (file)
@@ -391,7 +391,7 @@ STATIC void GC_remove_tmp_roots(void)
 GC_INNER ptr_t GC_approx_sp(void)
 {
     volatile word sp;
-#   if defined(__GNUC__) && (__GNUC__ >= 4)
+#   if defined(CPPCHECK) || (__GNUC__ >= 4)
         sp = (word)__builtin_frame_address(0);
 #   else
         sp = (word)&sp;