[PATCH] include/cygwin/limits.h: add XATTR_{NAME,SIZE,LIST}_MAX
Philippe Cerfon
philcerf@gmail.com
Tue Jun 6 15:17:34 GMT 2023
On Tue, Jun 6, 2023 at 3:28 PM Corinna Vinschen
<corinna-cygwin@cygwin.com> wrote:
> Yes, it is wrong, because the value of MAX_EA_NAME_LEN / XATTR_NAME_MAX
> is used for array size definitions as well as comparisons.
Do you prefer to keep MAX_EA_NAME_LEN and just have that set like,
perhaps with an additional comment that explains it:
#define MAX_EA_NAME_LEN (XATTR_NAME_MAX + 1 - strlen("user."))
or rather inline all that without any MAX_EA_NAME_LEN?
I think at least GCC and CLANG should be smart enough to optimise the
strlen() on a static string.
Regards,
Philippe
More information about the Cygwin-patches
mailing list