[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 1/3] Add sentinel attributes as appropriate
From: |
Tim Rühsen |
Subject: |
Re: [PATCH 1/3] Add sentinel attributes as appropriate |
Date: |
Tue, 2 Jun 2020 17:59:31 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.1 |
Hi John,
there is a new gnulib module 'attribute' which defines all the
attributes in a proper way (checking for compiler / version to support it).
Maybe it's a good time to use that module.
Regards, Tim
On 01.06.20 13:16, John Darrington wrote:
> ---
> common/pk-utils.h | 2 +-
> libpoke/libpoke.h | 3 ++-
> 2 files changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/common/pk-utils.h b/common/pk-utils.h
> index e3db7c76..54d4c51b 100644
> --- a/common/pk-utils.h
> +++ b/common/pk-utils.h
> @@ -51,7 +51,7 @@ uint64_t pk_upow (uint64_t base, uint32_t exp);
> void pk_print_binary (void (*puts_fn) (const char *str), uint64_t val, int
> size, int sign);
>
> /* Concatenate string arguments into an malloc'ed string. */
> -char *pk_str_concat (const char *s0, ...);
> +char *pk_str_concat (const char *s0, ...) __attribute__ ((sentinel));
>
> /* Replace all occurrences of SEARCH within IN by REPLACE. */
> char *pk_str_replace (const char *in, const char *search, const char
> *replace);
> diff --git a/libpoke/libpoke.h b/libpoke/libpoke.h
> index 5289a310..b44d6715 100644
> --- a/libpoke/libpoke.h
> +++ b/libpoke/libpoke.h
> @@ -346,7 +346,8 @@ int pk_defvar (pk_compiler pkc, const char *varname,
> pk_val val);
> execution of the function results in an unhandled exception.
> Return 1 otherwise. */
>
> -int pk_call (pk_compiler pkc, pk_val cls, pk_val *ret, ...);
> +int pk_call (pk_compiler pkc, pk_val cls, pk_val *ret, ...)
> + __attribute__ ((sentinel));
>
> /* Get and set properties of the incremental compiler. */
>
>
signature.asc
Description: OpenPGP digital signature