From b3b955bef2b7f95afa033c97e4c3df4b7e4b5568 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Mon, 1 Jul 2013 09:30:52 +0200 Subject: misc: Fix compiler warnings about the static_assert macro with gcc 4.8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The modified macro is still working on a gcc 4.7 and gcc 4.8 after the removal of the typedef and addition of the unused attribute. include/osmocom/core/msgb.h: In function ‘msgb_alloc_headroom’: include/osmocom/core/utils.h:40:51: warning: typedef ‘dummyheadroom_bigger’ locally defined but not used [-Wunused-local-typedefs] #define osmo_static_assert(exp, name) typedef int dummy##name [(exp) ? 1 : -1]; ^ include/osmocom/core/msgb.h:386:2: note: in expansion of macro ‘osmo_static_assert’ osmo_static_assert(size > headroom, headroom_bigger); ^ --- include/osmocom/core/utils.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/osmocom/core/utils.h') diff --git a/include/osmocom/core/utils.h b/include/osmocom/core/utils.h index f8e6fc96..c8efce29 100644 --- a/include/osmocom/core/utils.h +++ b/include/osmocom/core/utils.h @@ -37,7 +37,7 @@ char *osmo_hexdump(const unsigned char *buf, int len); char *osmo_hexdump_nospc(const unsigned char *buf, int len); char *osmo_osmo_hexdump_nospc(const unsigned char *buf, int len) __attribute__((__deprecated__)); -#define osmo_static_assert(exp, name) typedef int dummy##name [(exp) ? 1 : -1]; +#define osmo_static_assert(exp, name) int dummy##name [(exp) ? 1 : -1] __attribute__((__unused__)); void osmo_str2lower(char *out, const char *in); void osmo_str2upper(char *out, const char *in); -- cgit v1.2.3