From 3de2c290fe760f92622007097218005ba735f382 Mon Sep 17 00:00:00 2001 From: Bernhard Schelling <14200249+schellingb@users.noreply.github.com> Date: Thu, 10 Dec 2020 09:35:08 +0900 Subject: [PATCH] Mark function possibly unused to suppress warning Add attribute to avoid the warnings "rbuf__grow' defined but not used [-Wunused-function]" (GCC/Clang) and "unreferenced local function has been removed" (MSVC). --- libretro-common/include/array/rbuf.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/libretro-common/include/array/rbuf.h b/libretro-common/include/array/rbuf.h index 3ec15380a3..deb045fbbb 100644 --- a/libretro-common/include/array/rbuf.h +++ b/libretro-common/include/array/rbuf.h @@ -85,6 +85,12 @@ struct rbuf__hdr size_t cap; }; +#ifdef __GNUC__ +__attribute__((__unused__)) +#elif defined(_MSC_VER) +#pragma warning(push) +#pragma warning(disable:4505) //unreferenced local function has been removed +#endif static void *rbuf__grow(void *buf, size_t new_len, size_t elem_size) { @@ -107,5 +113,8 @@ static void *rbuf__grow(void *buf, new_hdr->cap = new_cap; return new_hdr + 1; } +#if defined(_MSC_VER) +#pragma warning(pop) +#endif #endif