From b9ad0444e2776f44c7290752b87a7deab0fefb78 Mon Sep 17 00:00:00 2001 From: Eric Blake Date: Wed, 4 Sep 2013 17:06:35 -0600 Subject: [PATCH] glob: avoid -Wattribute warnings on glibc Colin Watson reported that some versions of gcc warn about the use of attribute((leaf)) on static functions, since it is documented to have an effect only on external functions. * lib/glob.c (next_brace_sub, prefix_array, collated_compare): Use __THROWNL, not __THROW, on static functions. * lib/glob.in.h (__THROW): Adjust... (__THROWNL): ...accordingly. Signed-off-by: Eric Blake --- ChangeLog | 8 ++++++++ lib/glob.c | 6 +++--- lib/glob.in.h | 4 ++-- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 949bb048b5..91836211d8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2013-09-04 Eric Blake + + glob: avoid -Wattribute warnings on glibc + * lib/glob.c (next_brace_sub, prefix_array, collated_compare): Use + __THROWNL, not __THROW, on static functions. + * lib/glob.in.h (__THROW): Adjust... + (__THROWNL): ...accordingly. + 2013-08-28 Paul Eggert headers: check that _GL_INLINE_HEADER_BEGIN is defined diff --git a/lib/glob.c b/lib/glob.c index bf90a00450..7ec066fbee 100644 --- a/lib/glob.c +++ b/lib/glob.c @@ -162,7 +162,7 @@ # define GET_LOGIN_NAME_MAX() (-1) #endif -static const char *next_brace_sub (const char *begin, int flags) __THROW; +static const char *next_brace_sub (const char *begin, int flags) __THROWNL; #endif /* !defined _LIBC || !defined GLOB_ONLY_P */ @@ -210,8 +210,8 @@ extern int __glob_pattern_type (const char *pattern, int quote) attribute_hidden; #if !defined _LIBC || !defined GLOB_ONLY_P -static int prefix_array (const char *prefix, char **array, size_t n) __THROW; -static int collated_compare (const void *, const void *) __THROW; +static int prefix_array (const char *prefix, char **array, size_t n) __THROWNL; +static int collated_compare (const void *, const void *) __THROWNL; /* Find the end of the sub-pattern in a brace expression. */ diff --git a/lib/glob.in.h b/lib/glob.in.h index 49e15c0285..c242d97b3e 100644 --- a/lib/glob.in.h +++ b/lib/glob.in.h @@ -40,8 +40,8 @@ # define __END_DECLS # endif #endif -#ifndef __THROW -# define __THROW +#ifndef __THROWNL +# define __THROWNL #endif /* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */ -- 2.39.5