Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.std.c > #6647

Re: May a string span multiple, independent objects?

Path csiph.com!fu-berlin.de!uni-berlin.de!news.dfncis.de!not-for-mail
From Hans-Bernhard Bröker <HBBroeker@gmail.com>
Newsgroups comp.std.c
Subject Re: May a string span multiple, independent objects?
Date Wed, 3 Jul 2024 17:23:24 +0200
Lines 18
Message-ID <lel8ndF7f8iU1@mid.dfncis.de> (permalink)
References <20240703141500$00ed@vinc17.org>
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding 7bit
X-Trace news.dfncis.de kGL5hQuKZytRuuOAA8CWqQe3KIjXb7Y0wycobprwKQ0DKPkUuTUTrVE0Y/
Cancel-Lock sha1:306BY8pr1nA6ZGkbqA3hyApYi58= sha256:LBr5ihNgxgj5PwtHP2VxVvrEryYW/fKjy3jQwyJ/S18=
User-Agent Mozilla Thunderbird
Content-Language de-DE, en-US
In-Reply-To <20240703141500$00ed@vinc17.org>
Xref csiph.com comp.std.c:6647

Show key headers only | View raw


Am 03.07.2024 um 16:31 schrieb Vincent Lefevre:
> ISO C17 (and C23 draft) 7.1.1 defines a string as follows: "A string
> is a contiguous sequence of characters terminated by and including
> the first null character."
> 
> But may a string span multiple, independent objects that happens
> to be contiguous in memory?
> 
> For instance, is the following program valid and what does the ISO C
> standard say about that?

Comparing pointers pointing at distinct objects is already invalid (for 
some interpretation of "invalid"), so: no.  Yes, that means the 
implementation of a function like memmove() cannot be fully portable C.

A program whose correctness relies on things "happening to be" just like 
so cannot possibly be entirely valid.

Back to comp.std.c | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

May a string span multiple, independent objects? Vincent Lefevre <vincent-news@vinc17.net> - 2024-07-03 14:31 +0000
  Re: May a string span multiple, independent objects? Hans-Bernhard Bröker <HBBroeker@gmail.com> - 2024-07-03 17:23 +0200
    Re: May a string span multiple, independent objects? Vincent Lefevre <vincent-news@vinc17.net> - 2024-07-03 15:37 +0000
    Re: May a string span multiple, independent objects? James Kuyper <jameskuyper@alumni.caltech.edu> - 2024-07-03 12:11 -0400
    Re: May a string span multiple, independent objects? Tim Rentsch <tr.17687@z991.linuxsc.com> - 2024-08-08 08:51 -0700
  Re: May a string span multiple, independent objects? James Kuyper <jameskuyper@alumni.caltech.edu> - 2024-07-03 11:59 -0400
    Re: May a string span multiple, independent objects? Ben Bacarisse <ben@bsb.me.uk> - 2024-07-03 22:08 +0100
      Re: May a string span multiple, independent objects? James Kuyper <jameskuyper@alumni.caltech.edu> - 2024-07-03 17:36 -0400
      Re: May a string span multiple, independent objects? Vincent Lefevre <vincent-news@vinc17.net> - 2024-07-04 13:22 +0000
        Re: May a string span multiple, independent objects? Ben Bacarisse <ben@bsb.me.uk> - 2024-07-05 05:14 +0100
        Re: May a string span multiple, independent objects? James Kuyper <jameskuyper@alumni.caltech.edu> - 2024-07-05 01:37 -0400
        Re: May a string span multiple, independent objects? Tim Rentsch <tr.17687@z991.linuxsc.com> - 2024-08-08 08:35 -0700
  Re: May a string span multiple, independent objects? Kaz Kylheku <643-408-1753@kylheku.com> - 2024-07-05 07:14 +0000

csiph-web