[libunwind] Fix warning when building without frameheader cache
authorMikael Holmen <mikael.holmen@ericsson.com>
Tue, 25 Aug 2020 10:26:48 +0000 (12:26 +0200)
committerMikael Holmen <mikael.holmen@ericsson.com>
Tue, 25 Aug 2020 10:58:39 +0000 (12:58 +0200)
Without the fix the compiler warns with

/data/repo/master/libunwind/src/AddressSpace.hpp:436:44: warning: unused parameter 'pinfo_size' [-Wunused-parameter]
                                    size_t pinfo_size, void *data) {
                                           ^
1 warning generated.

libunwind/src/AddressSpace.hpp

index b3949b2..717aa33 100644 (file)
@@ -440,6 +440,9 @@ static int findUnwindSectionsByPhdr(struct dl_phdr_info *pinfo,
 #if defined(_LIBUNWIND_USE_FRAME_HEADER_CACHE)
   if (ProcessFrameHeaderCache.find(pinfo, pinfo_size, data))
     return 1;
+#else
+  // Avoid warning about unused variable.
+  (void)pinfo_size;
 #endif
 
   Elf_Addr image_base = calculateImageBase(pinfo);