arrfab / rpms / glibc

Forked from rpms/glibc 5 years ago
Clone

Blame SOURCES/glibc-rh1505492-unused-8.patch

147e83
commit c82f5c0ce5c1c0180fca311ceb29fd2d59da7441
147e83
Author: Joseph Myers <joseph@codesourcery.com>
147e83
Date:   Wed Nov 26 00:45:19 2014 +0000
147e83
147e83
    Fix warning in setjmp/jmpbug.c.
147e83
    
147e83
    This patch fixes a "set but not used" warning in setjmp/jmpbug.c.  A
147e83
    variable is used only to store the result of alloca.  A cast to void
147e83
    is added to avoid the warning, and the variable is made volatile to
147e83
    ensure the call to alloca isn't optimized away for being unused.
147e83
    
147e83
    Tested for x86_64.
147e83
    
147e83
            * setjmp/jmpbug.c (test): Make foo volatile and cast it to
147e83
            void.
147e83
147e83
diff --git a/setjmp/jmpbug.c b/setjmp/jmpbug.c
147e83
index 125977b2f719dbeb..8594c5a8a782b218 100644
147e83
--- a/setjmp/jmpbug.c
147e83
+++ b/setjmp/jmpbug.c
147e83
@@ -14,7 +14,7 @@ static void
147e83
 test (int x)
147e83
 {
147e83
   jmp_buf buf;
147e83
-  char *foo;
147e83
+  char *volatile foo;
147e83
   int arr[100];
147e83
 
147e83
   arr[77] = x;
147e83
@@ -25,6 +25,7 @@ test (int x)
147e83
     }
147e83
 
147e83
   foo = (char *) alloca (128);
147e83
+  (void) foo;
147e83
   sub5 (buf);
147e83
 }
147e83