intel: aubinator: mark ftruncate_res as MAYBE_UNUSED in ensure_phys_mem
authorKai Wasserbäch <kai@dev.carbon-project.org>
Sat, 18 Aug 2018 11:16:11 +0000 (13:16 +0200)
committerLionel Landwerlin <lionel.g.landwerlin@intel.com>
Mon, 20 Aug 2018 10:08:52 +0000 (11:08 +0100)
Only used, when asserts are enabled.

Fixes an unused-variable warning with GCC 8:
 ../../../src/intel/tools/aubinator.c: In function 'ensure_phys_mem':
 ../../../src/intel/tools/aubinator.c:209:11: warning: unused variable 'ftruncate_res' [-Wunused-variable]
        int ftruncate_res = ftruncate(mem_fd, mem_fd_len += 4096);
            ^~~~~~~~~~~~~

Signed-off-by: Kai Wasserbäch <kai@dev.carbon-project.org>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
src/intel/tools/aubinator.c

index 9a3b1d1ef1de8f4bd93da2949f497be19e8e8f70..66a7db1043bced5bab56091018bb9c83ff15a4b5 100644 (file)
@@ -206,7 +206,7 @@ ensure_phys_mem(uint64_t phys_addr)
       new_mem->phys_addr = phys_addr;
       new_mem->fd_offset = mem_fd_len;
 
-      int ftruncate_res = ftruncate(mem_fd, mem_fd_len += 4096);
+      MAYBE_UNUSED int ftruncate_res = ftruncate(mem_fd, mem_fd_len += 4096);
       assert(ftruncate_res == 0);
 
       new_mem->data = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_SHARED,