commit f1763cd2d3b77582309288198e56de5d883b425a Author: Jonathan Wakely Date: Thu Sep 30 17:24:54 2021 +0100 stdlib: Add braces around return statement in bsearch The diagnostic pragmas are apparently interpreted as the statement following the else, so add braces around them to create a block statement containing the pragmas and the return statement. Signed-off-by: Jonathan Wakely diff --git a/bits/stdlib-bsearch.h b/bits/stdlib-bsearch.h index d688ed2e15..c4b485edf8 100644 --- a/bits/stdlib-bsearch.h +++ b/bits/stdlib-bsearch.h @@ -36,14 +36,16 @@ bsearch (const void *__key, const void *__base, size_t __nmemb, size_t __size, else if (__comparison > 0) __l = __idx + 1; else + { #if __GNUC_PREREQ(4, 6) # pragma GCC diagnostic push # pragma GCC diagnostic ignored "-Wcast-qual" #endif - return (void *) __p; + return (void *) __p; #if __GNUC_PREREQ(4, 6) # pragma GCC diagnostic pop #endif + } } return NULL;