From: Alejandro Colomar via Libc-alpha <libc-alpha@sourceware.org>
To: Mike Frysinger <vapier@gentoo.org>,
"Seija K." <doremylover123@gmail.com>
Cc: libc-alpha@sourceware.org
Subject: Re: Add restrict annotations to all functions that require it
Date: Sun, 27 Nov 2022 13:00:45 +0100 [thread overview]
Message-ID: <553333c5-cccc-9e9c-81ec-c47436c00b16@gmail.com> (raw)
In-Reply-To: <Y4NNqS2jacPzdy/f@vapier>
[-- Attachment #1.1: Type: text/plain, Size: 802 bytes --]
Hi,
On 11/27/22 12:44, Mike Frysinger via Libc-alpha wrote:
> On 26 Nov 2022 19:56, Seija K. via Libc-alpha wrote:
>> The format value has to be a string literal, every time. Otherwise, you are
>> not using these functions correctly. To reinforce this fact, I put
>> __restrict over every example of this I could find.
>
> there's at least some redundant settings in here that aren't needed. for
> example, the strptime prototype in time/time.h has restrict on fmt already,
> so it isn't needed in time/strptime.c.
> -mike
I just confirmed that neither clang(1) nor clang-tidy(1) emit any warnings (with
warnings to -Weverything and checks to *) at all if only the prototype has
restrict. So yes, it seems redundant.
Cheers,
Alex
--
<http://www.alejandro-colomar.es/>
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2022-11-27 12:01 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-27 0:56 Add restrict annotations to all functions that require it Seija K. via Libc-alpha
2022-11-27 11:44 ` Mike Frysinger via Libc-alpha
2022-11-27 12:00 ` Alejandro Colomar via Libc-alpha [this message]
2022-12-03 14:32 ` Alejandro Colomar via Libc-alpha
2022-12-06 23:57 ` Joseph Myers
2022-12-07 11:59 ` Alejandro Colomar via Libc-alpha
2022-12-07 19:05 ` Joseph Myers
2022-11-27 12:04 ` Alejandro Colomar via Libc-alpha
2022-11-27 12:30 ` Alejandro Colomar via Libc-alpha
2022-11-27 12:39 ` Alejandro Colomar via Libc-alpha
2022-11-28 21:17 ` Joseph Myers
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
List information: https://www.gnu.org/software/libc/involved.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=553333c5-cccc-9e9c-81ec-c47436c00b16@gmail.com \
--to=libc-alpha@sourceware.org \
--cc=alx.manpages@gmail.com \
--cc=doremylover123@gmail.com \
--cc=vapier@gentoo.org \
/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).