From ed99f3608df3d6dd4c8c7d52d608a8212203dfe4 Mon Sep 17 00:00:00 2001 From: Christian Jullien Date: Wed, 30 Nov 2016 06:18:48 +0100 Subject: [PATCH] Remove warning when __builtin_frame_address is used with gcc >= 6. --- lib/bcheck.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/lib/bcheck.c b/lib/bcheck.c index 756c539b..d3b9955c 100644 --- a/lib/bcheck.c +++ b/lib/bcheck.c @@ -234,6 +234,15 @@ BOUND_PTR_INDIR(8) BOUND_PTR_INDIR(12) BOUND_PTR_INDIR(16) +#if defined(__GNUC__) && (__GNUC__ >= 6) +/* + * At least gcc 6.2 complains when __builtin_frame_address is used whith + * nonzero argument. + */ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wframe-address" +#endif + /* return the frame pointer of the caller */ #define GET_CALLER_FP(fp)\ {\ @@ -274,6 +283,10 @@ void FASTCALL __bound_local_delete(void *p1) } } +#if defined(__GNUC__) && (__GNUC__ >= 6) +#pragma GCC diagnostic pop +#endif + static BoundEntry *__bound_new_page(void) { BoundEntry *page;