coreutils
[Top][All Lists]
Advanced

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

Re: [PATCH 3/4] stat: fix up __attribute__ (const) declarations


From: Dominique Martinet
Subject: Re: [PATCH 3/4] stat: fix up __attribute__ (const) declarations
Date: Wed, 5 Jun 2019 17:59:15 +0200

Pádraig Brady wrote on Mon, Jun 03, 2019 at 03:55:51AM +0100:
> * src/stat.c (format_to_mask): Functions that inspect
> memory of pointer arguments must not be declared const.
> Also use the _GL_ATTRIBUTE_PURE defines which will be
> set appropriately per compiler.
> ---
>  src/stat.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/src/stat.c b/src/stat.c
> index fe52e0f..3e8f531 100644
> --- a/src/stat.c
> +++ b/src/stat.c
> @@ -1078,7 +1078,7 @@ print_esc_char (char c)
>    putchar (c);
>  }
>  
> -static size_t __attribute__((pure))
> +static size_t _GL_ATTRIBUTE_PURE
>  format_code_offset (char const* directive)
>  {
>    size_t len = strspn (directive + 1, printf_flags);
> @@ -1456,7 +1456,7 @@ fmt_to_mask (char fmt)
>    return 0;
>  }
>  
> -static unsigned int __attribute__((const))
> +static unsigned int _GL_ATTRIBUTE_PURE

This one was probably meant to be _GL_ATTRIBUTE_CONST

>  format_to_mask (char const *format)
>  {
>    unsigned int mask = 0;
-- 
Dominique Martinet
(just passing by, startx being used will be nice!)



reply via email to

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