From 58f8347e84d2820cada64c513bb0f2b81ecd494a Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sun, 10 Jul 2016 16:00:34 +0200 Subject: Fix new GCC warnings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/libmdsserver/util.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/libmdsserver/util.c') diff --git a/src/libmdsserver/util.c b/src/libmdsserver/util.c index 14df3a9..a3e18a9 100644 --- a/src/libmdsserver/util.c +++ b/src/libmdsserver/util.c @@ -298,6 +298,13 @@ int strict_atoj(const char* str, intmax_t* value, intmax_t min, intmax_t max) } +#if defined(__GNUC__) +/* GCC says strict_atouj is a candidate for the attribute ‘pure’, + * however the line `*value = r` means that it is not, at least + * if you only consider what GCC's manuals says about the attribute. */ +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wsuggest-attribute=pure" +#endif /** * A version of `atouj` that is strict about the syntax and bounds * @@ -334,6 +341,9 @@ int strict_atouj(const char* str, uintmax_t* value, uintmax_t min, uintmax_t max *value = r; return 0; } +#if defined(__GNUC__) +# pragma GCC diagnostic pop +#endif #define __strict_y(Y, TYPE, PARA_TYPE, HYPER_Y, HYPER_TYPE) \ -- cgit v1.2.3-70-g09d2