public inbox for cygwin-patches@cygwin.com
 help / color / mirror / Atom feed
From: Philippe Cerfon <philcerf@gmail.com>
To: cygwin-patches@cygwin.com
Subject: Re: [PATCH] include/cygwin/limits.h: add XATTR_{NAME,SIZE,LIST}_MAX
Date: Tue, 6 Jun 2023 17:17:34 +0200	[thread overview]
Message-ID: <CAN+za=NXXrn_atWyWi4zUgELkhvm5qecB-hQYFJ7Q4bdFHopFA@mail.gmail.com> (raw)
In-Reply-To: <ZH80lgpsfWwCZp+R@calimero.vinschen.de>

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

  reply	other threads:[~2023-06-06 15:17 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAN+za=MhQdD2mzYxqVAm9ZwBUBKsyPiH+9T5xfGXtgxq1X1LAA@mail.gmail.com>
2023-05-30 20:04 ` Brian Inglis
2023-06-05 19:05   ` Corinna Vinschen
2023-06-06  1:04     ` Philippe Cerfon
2023-06-06  1:14     ` Philippe Cerfon
2023-06-06 13:28       ` Corinna Vinschen
2023-06-06 15:17         ` Philippe Cerfon [this message]
2023-06-07 10:06           ` Corinna Vinschen
2023-06-16 14:09             ` Philippe Cerfon
2023-06-16 15:04               ` Corinna Vinschen
2023-06-16 15:43                 ` Philippe Cerfon
2023-06-16 19:49                   ` Corinna Vinschen
2023-06-16 19:52                     ` Philippe Cerfon
2023-06-19  8:53                       ` Corinna Vinschen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAN+za=NXXrn_atWyWi4zUgELkhvm5qecB-hQYFJ7Q4bdFHopFA@mail.gmail.com' \
    --to=philcerf@gmail.com \
    --cc=cygwin-patches@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).