瀏覽代碼

Fix unused parameter warnings in arena_free

The size parameter is only used in cases where the compiler supports
sized delete, so when that's not available we need to specifically cast
it to void to prevent a warning.
Adam Cozzette 9 年之前
父節點
當前提交
8785004c80
共有 1 個文件被更改,包括 1 次插入0 次删除
  1. 1 0
      src/google/protobuf/arena.h

+ 1 - 0
src/google/protobuf/arena.h

@@ -83,6 +83,7 @@ inline void arena_free(void* object, size_t size) {
 #if defined(__GXX_DELETE_WITH_SIZE__) || defined(__cpp_sized_deallocation)
   ::operator delete(object, size);
 #else
+  (void)size;
   ::operator delete(object);
 #endif
 }