From e9ce7aa8abe48068e825e8c1712d0dd9f36da247 Mon Sep 17 00:00:00 2001 From: Yi Kong Date: Tue, 11 Dec 2018 19:05:02 -0800 Subject: [PATCH] Ignore null-pointer-arithmetic warning from dlmalloc include system/core/libpixelflinger/codeflinger/../../../../external/dlmalloc/malloc.c:4286:61: error: arithmetic on a null pointer treated as a cast from integer to pointer is a GNU extension [-Werror,-Wnull-pointer-arithmetic] if (!is_inuse(p) && (char*)p + psize >= base + size - TOP_FOOT_SIZE) { ^~~~~~~~~~~~~ system/core/libpixelflinger/codeflinger/../../../../external/dlmalloc/malloc.c:2731:17: note: expanded from macro 'TOP_FOOT_SIZE' (align_offset(chunk2mem(0))+pad_request(sizeof(struct malloc_segment))+MIN_CHUNK_SIZE) ~~~~~~~~~~~~~^~~~~~~~~~~~~ system/core/libpixelflinger/codeflinger/../../../../external/dlmalloc/malloc.c:2218:55: note: expanded from macro 'chunk2mem' #define chunk2mem(p) ((void*)((char*)(p) + TWO_SIZE_T_SIZES)) ^ system/core/libpixelflinger/codeflinger/../../../../external/dlmalloc/malloc.c:1622:14: note: expanded from macro 'align_offset' ((((size_t)(A) & CHUNK_ALIGN_MASK) == 0)? 0 :\ Test: m checkbuild Bug: 72331524 Change-Id: Iefc3b4ae6b36ba9f6cb908c03301cbe429ade320 --- libpixelflinger/codeflinger/CodeCache.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/libpixelflinger/codeflinger/CodeCache.cpp b/libpixelflinger/codeflinger/CodeCache.cpp index 5ed668c6f..32691a389 100644 --- a/libpixelflinger/codeflinger/CodeCache.cpp +++ b/libpixelflinger/codeflinger/CodeCache.cpp @@ -63,6 +63,7 @@ static void heap_error(const char* msg, const char* function, void* p); #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wexpansion-to-defined" +#pragma GCC diagnostic ignored "-Wnull-pointer-arithmetic" #include "../../../../external/dlmalloc/malloc.c" #pragma GCC diagnostic pop