[PATCH] posix: avoid a cast in regex syntax bit definitions
Arjun Shankar
arjun@redhat.com
Mon Feb 2 14:19:04 GMT 2026
> The cast doesn't have any benefit over using a UL suffix and prevents
> the macro from being used in preprocessor directives.
This looks good to me.
Reviewed-by: Arjun Shankar <arjun@redhat.com>
> ---
> posix/regex.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/posix/regex.h b/posix/regex.h
> index 192d5bf2a3..2d8392cf84 100644
> --- a/posix/regex.h
> +++ b/posix/regex.h
> @@ -74,7 +74,7 @@ typedef unsigned long int reg_syntax_t;
> #ifdef __USE_GNU
> /* If this bit is not set, then \ inside a bracket expression is literal.
> If set, then such a \ quotes the following character. */
> -# define RE_BACKSLASH_ESCAPE_IN_LISTS ((unsigned long int) 1)
> +# define RE_BACKSLASH_ESCAPE_IN_LISTS 1ul
OK.
>
> /* If this bit is not set, then + and ? are operators, and \+ and \? are
> literals.
> --
> 2.52.0
>
More information about the Libc-alpha
mailing list