Avoid C99 for-declaration statement in C files. (NFC)
authorLogan Chien <tzuhsiang.chien@gmail.com>
Thu, 25 Jun 2015 00:05:24 +0000 (00:05 +0000)
committerLogan Chien <tzuhsiang.chien@gmail.com>
Thu, 25 Jun 2015 00:05:24 +0000 (00:05 +0000)
To compile libunwind with gcc/g++ 4.9, it is required to avoid the
for-declaration statement from C99.

llvm-svn: 240609

libunwind/src/UnwindLevel1.c

index 84627c253b0443d09ecb8a1100ff47188639c40a..61abd890d9e61715b7f83b0242d0b83e101fbfc0 100644 (file)
@@ -31,8 +31,8 @@ unwind_phase1(unw_context_t *uc, _Unwind_Exception *exception_object) {
   unw_init_local(&cursor1, uc);
 
   // Walk each frame looking for a place to stop.
-  for (bool handlerNotFound = true; handlerNotFound;) {
-
+  bool handlerNotFound = true;
+  while (handlerNotFound) {
     // Ask libuwind to get next frame (skip over first which is
     // _Unwind_RaiseException).
     int stepResult = unw_step(&cursor1);