Index: libunwind/CMakeLists.txt =================================================================== --- libunwind/CMakeLists.txt +++ libunwind/CMakeLists.txt @@ -191,6 +191,7 @@ add_compile_flags_if_supported(-Wsign-conversion) add_compile_flags_if_supported(-Wstrict-aliasing=2) add_compile_flags_if_supported(-Wstrict-overflow=4) +add_compile_flags_if_supported(-Wunused-but-set-variable) add_compile_flags_if_supported(-Wunused-parameter) add_compile_flags_if_supported(-Wunused-variable) add_compile_flags_if_supported(-Wwrite-strings) Index: libunwind/src/Unwind-EHABI.cpp =================================================================== --- libunwind/src/Unwind-EHABI.cpp +++ libunwind/src/Unwind-EHABI.cpp @@ -461,6 +461,7 @@ return _URC_FATAL_PHASE1_ERROR; } +#ifndef NDEBUG // When tracing, print state information. if (_LIBUNWIND_TRACING_UNWINDING) { char functionBuf[512]; @@ -479,6 +480,7 @@ frameInfo.start_ip, functionName, frameInfo.lsda, frameInfo.handler); } +#endif // If there is a personality routine, ask it if it will want to stop at // this frame. @@ -580,6 +582,7 @@ return _URC_FATAL_PHASE2_ERROR; } +#ifndef NDEBUG // When tracing, print state information. if (_LIBUNWIND_TRACING_UNWINDING) { char functionBuf[512]; @@ -596,6 +599,7 @@ functionName, sp, frameInfo.lsda, frameInfo.handler); } +#endif // If there is a personality routine, tell it we are unwinding. if (frameInfo.handler != 0) { @@ -687,6 +691,7 @@ return _URC_FATAL_PHASE2_ERROR; } +#ifndef NDEBUG // When tracing, print state information. if (_LIBUNWIND_TRACING_UNWINDING) { char functionBuf[512]; @@ -702,6 +707,7 @@ (void *)exception_object, frameInfo.start_ip, functionName, frameInfo.lsda, frameInfo.handler); } +#endif // Call stop function at each frame. _Unwind_Action action = Index: libunwind/src/Unwind-seh.cpp =================================================================== --- libunwind/src/Unwind-seh.cpp +++ libunwind/src/Unwind-seh.cpp @@ -244,6 +244,7 @@ return _URC_FATAL_PHASE2_ERROR; } +#ifndef NDEBUG // When tracing, print state information. if (_LIBUNWIND_TRACING_UNWINDING) { char functionBuf[512]; @@ -259,6 +260,7 @@ (void *)exception_object, frameInfo.start_ip, functionName, frameInfo.lsda, frameInfo.handler); } +#endif // Call stop function at each frame. _Unwind_Action action = Index: libunwind/src/UnwindLevel1.c =================================================================== --- libunwind/src/UnwindLevel1.c +++ libunwind/src/UnwindLevel1.c @@ -68,6 +68,7 @@ return _URC_FATAL_PHASE1_ERROR; } +#ifndef NDEBUG // When tracing, print state information. if (_LIBUNWIND_TRACING_UNWINDING) { char functionBuf[512]; @@ -85,6 +86,7 @@ (void *)exception_object, pc, frameInfo.start_ip, functionName, frameInfo.lsda, frameInfo.handler); } +#endif // If there is a personality routine, ask it if it will want to stop at // this frame. @@ -167,6 +169,7 @@ return _URC_FATAL_PHASE2_ERROR; } +#ifndef NDEBUG // When tracing, print state information. if (_LIBUNWIND_TRACING_UNWINDING) { char functionBuf[512]; @@ -183,6 +186,7 @@ functionName, sp, frameInfo.lsda, frameInfo.handler); } +#endif // If there is a personality routine, tell it we are unwinding. if (frameInfo.handler != 0) { @@ -258,6 +262,7 @@ return _URC_FATAL_PHASE2_ERROR; } +#ifndef NDEBUG // When tracing, print state information. if (_LIBUNWIND_TRACING_UNWINDING) { char functionBuf[512]; @@ -273,6 +278,7 @@ (void *)exception_object, frameInfo.start_ip, functionName, frameInfo.lsda, frameInfo.handler); } +#endif // Call stop function at each frame. _Unwind_Action action =