public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@redhat.com>
To: Segher Boessenkool <segher@kernel.crashing.org>
Cc: Alexander Monakov <amonakov@ispras.ru>,
	       Eduard-Mihai Burtescu <eddyb@lyken.rs>,
	       Ian Lance Taylor <iant@google.com>,
	       gcc-patches <gcc-patches@gcc.gnu.org>,
	Ian Lance Taylor <ian@airs.com>
Subject: Re: [PATCH] Refactor rust-demangle to be independent of C++ demangling.
Date: Wed, 23 Oct 2019 17:37:00 -0000	[thread overview]
Message-ID: <20191023172848.GH2116@tucnak> (raw)
In-Reply-To: <20191023171910.GP28442@gate.crashing.org>

On Wed, Oct 23, 2019 at 12:19:10PM -0500, Segher Boessenkool wrote:
> I of course know that for e.g. strcmp or strlen we need to be careful of
> page crossings; but this is strncmp, which has a size argument saying the
> size of the array objects of its arguments!

https://pubs.opengroup.org/onlinepubs/009695399/functions/strncmp.html
The strncmp() function shall compare not more than n bytes
(bytes that follow a null byte are not compared)
from the array pointed to by s1 to the array pointed to by s2.

In particular the second line.

Similarly C11 7.24.4.4:
The strncmp function compares not more than n characters (characters that follow a
null character are not compared) from the array pointed to by s1 to the array pointed to
by s2.

Similarly C99.

	Jakub

  reply	other threads:[~2019-10-23 17:29 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-22 18:24 Eduard-Mihai Burtescu
2019-10-22 18:48 ` Ian Lance Taylor via gcc-patches
2019-10-23 14:29   ` Eduard-Mihai Burtescu
2019-10-23 16:37     ` Alexander Monakov
2019-10-23 16:41       ` Segher Boessenkool
2019-10-23 17:19         ` Jakub Jelinek
2019-10-23 17:29           ` Segher Boessenkool
2019-10-23 17:37             ` Jakub Jelinek [this message]
2019-10-23 17:43               ` Segher Boessenkool
2019-10-25 12:46       ` Eduard-Mihai Burtescu
2019-10-30 16:56         ` Eduard-Mihai Burtescu
2019-11-08 17:02           ` Eduard-Mihai Burtescu
2019-11-08 17:44             ` Ian Lance Taylor via gcc-patches
2019-11-08 19:17               ` Eduard-Mihai Burtescu
2019-11-08 19:23                 ` Ian Lance Taylor via gcc-patches
2019-11-15 21:00                   ` Eduard-Mihai Burtescu
2019-11-16 15:39                 ` Jeff Law

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=20191023172848.GH2116@tucnak \
    --to=jakub@redhat.com \
    --cc=amonakov@ispras.ru \
    --cc=eddyb@lyken.rs \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=ian@airs.com \
    --cc=iant@google.com \
    --cc=segher@kernel.crashing.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).