amd/addrlib: mark returnCode as MAYBE_UNUSED in ElemGetExportNorm
authorKai Wasserbäch <kai@dev.carbon-project.org>
Fri, 17 Aug 2018 10:14:22 +0000 (12:14 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Wed, 22 Aug 2018 18:33:21 +0000 (14:33 -0400)
Only used, when asserts are enabled.

Fixes an unused-but-set-variable warning with GCC 8:
 ../../../src/amd/addrlib/addrinterface.cpp: In function 'int ElemGetExportNorm(ADDR_HANDLE, const ELEM_GETEXPORTNORM_INPUT*)':
 ../../../src/amd/addrlib/addrinterface.cpp:835:23: warning: variable 'returnCode' set but not used [-Wunused-but-set-variable]
      ADDR_E_RETURNCODE returnCode = ADDR_OK;
                        ^~~~~~~~~~

Signed-off-by: Kai Wasserbäch <kai@dev.carbon-project.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/amd/Makefile.addrlib.am
src/amd/addrlib/addrinterface.cpp

index 75ff7fbcf758ba4cb78e345a33004ba6be4b2777..af0daf907d54fa108a55ddf42544ce17d9dba383 100644 (file)
@@ -24,6 +24,7 @@ ADDRLIB_LIBS = addrlib/libamdgpu_addrlib.la
 addrlib_libamdgpu_addrlib_la_CPPFLAGS = \
        $(DEFINES) \
        -I$(top_srcdir)/src/ \
+       -I$(top_srcdir)/include \
        -I$(srcdir)/common \
        -I$(srcdir)/addrlib \
        -I$(srcdir)/addrlib/core \
index 112431e2cb486a996402152c7417782aaa7b23bd..9cbeba41d978f226e5fdd93d8bc72643f0abc9ab 100644 (file)
@@ -36,6 +36,8 @@
 
 #include "addrcommon.h"
 
+#include "util/macros.h"
+
 using namespace Addr;
 
 ////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -832,7 +834,7 @@ BOOL_32 ADDR_API ElemGetExportNorm(
     Addr::Lib* pLib = Lib::GetLib(hLib);
     BOOL_32 enabled = FALSE;
 
-    ADDR_E_RETURNCODE returnCode = ADDR_OK;
+    MAYBE_UNUSED ADDR_E_RETURNCODE returnCode = ADDR_OK;
 
     if (pLib != NULL)
     {