bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] acl-internal.h: remove _GL_ATTRIBUTE_CONST on void function


From: Bruno Haible
Subject: Re: [PATCH] acl-internal.h: remove _GL_ATTRIBUTE_CONST on void function
Date: Tue, 26 Jun 2018 03:20:17 +0200
User-agent: KMail/5.1.3 (Linux/4.4.0-128-generic; KDE/5.18.0; x86_64; ; )

Hi Jim,

> diff --git a/lib/acl-internal.h b/lib/acl-internal.h
> index 6c65e65e5..0669d83c4 100644
> --- a/lib/acl-internal.h
> +++ b/lib/acl-internal.h
> @@ -293,10 +293,6 @@ struct permission_context {
> 
>  int get_permissions (const char *, int, mode_t, struct permission_context *);
>  int set_permissions (struct permission_context *, const char *, int);
> -void free_permission_context (struct permission_context *)
> -#if ! (defined USE_ACL && (HAVE_ACL_GET_FILE || defined GETACL))
> -    _GL_ATTRIBUTE_CONST
> -#endif
> -  ;
> +void free_permission_context (struct permission_context *);
> 
>  _GL_INLINE_HEADER_END
> 

Now, on Ubuntu 16.04, with gcc 5.4.0, I get this compilation error in
coreutils:

  CC       lib/acl-internal.o
lib/acl-internal.c: In function 'free_permission_context':
lib/acl-internal.c:479:1: error: function might be candidate for attribute 
'const' [-Werror=suggest-attribute=const]
 free_permission_context (struct permission_context *ctx)
 ^
cc1: all warnings being treated as errors
Makefile:9618: recipe for target 'lib/acl-internal.o' failed
make[2]: *** [lib/acl-internal.o] Error 1
make[2]: Leaving directory '/media/develdata/devel/COREUTILS/coreutils'


One version of GCC wants the 'const' attribute, another one complains
about it...

Isn't it time to disable either -Werror or -Wattribute?

Bruno




reply via email to

[Prev in Thread] Current Thread [Next in Thread]