Path: csiph.com!eternal-september.org!feeder.eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: Tim Rentsch
Newsgroups: comp.lang.c
Subject: Re: C String terminator
Date: Sat, 04 Apr 2020 20:34:04 -0700
Organization: A noiseless patient Spider
Lines: 67
Message-ID: <86y2ramwr7.fsf@linuxsc.com>
References: <877e1rc6f7.fsf@bsb.me.uk> <87v9p9bylk.fsf@bsb.me.uk> <861rrtj9hx.fsf@linuxsc.com> <87d0bc8xf6.fsf@nosuchdomain.example.com> <861rquhlqk.fsf@linuxsc.com> <87wo8m9nm4.fsf@nosuchdomain.example.com> <86imjyd2hl.fsf@linuxsc.com> <87blpqa6y6.fsf@nosuchdomain.example.com> <867dz589t3.fsf@linuxsc.com> <875zepvvu1.fsf@nosuchdomain.example.com> <86sghl6eop.fsf@linuxsc.com> <61f8fb26-45fb-46c4-8bf4-d85d8fb94a8d@googlegroups.com> <86a73tpb20.fsf@linuxsc.com> <2a770f28-0124-4b7e-8da3-24c05dd75636@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Info: reader02.eternal-september.org; posting-host="33313a58d422a0b61b629db649debaea"; logging-data="15486"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+RZmtDFqNZY11M5Xd+qaWiRN89/uXWFIY="
User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux)
Cancel-Lock: sha1:K6QaS3YI9saOilOry7oB4g2c9fc= sha1:uRGoPce0AMcabzbhhLbzLH/yUeg=
Xref: csiph.com comp.lang.c:151043
already5chosen@yahoo.com writes:
> On Friday, April 3, 2020 at 10:48:08 AM UTC+3, [...] wrote:
>
>> On 03/04/2020 04:17, Tim Rentsch wrote:
>>
>>> Malcolm McLean writes:
>>>
>>>> On Thursday, 2 April 2020 17:22:11 UTC+1, Tim Rentsch wrote:
>>>>
>>>>> [There was an attribution missing here, which I have not
>>>>> tried to restore]
>>>>>
>>>>>> Regarding a point I raised above, 3.7.1 defines a "character"
>>>>>> as a "bit representation that fits in a byte", and 7.1.1 defines
>>>>>> a "string" as a sequence of characters -- but "%s" specifically
>>>>>> requires a pointer to the initial element of an array of character
>>>>>> type, i.e., one of char, signed char, or unsigned char. I see
>>>>>> no requirement that a "character" must be of "character type".
>>>>>> Possibly the standard's definition of "character" is incomplete
>>>>>> and/or does not fully convey the intent.
>>>>>
>>>>> The term "character" is a restriction on values, not types. The
>>>>> constant 's' is a character, but has type int.
>>>>
>>>> That's so that EOF can be coded as -1, and is not a "character".
>>>>
>>>>> .
>>>>> I haven't checked this, but I feel confident the Standard avoids
>>>>> all of these problems by, eg, using parameter types such as 'char *'
>>>>> so there is no question about what type is being referred to, or
>>>>> by doing what is done for printf, namely, giving the specification
>>>>> so it references "an array of character type".
>>>>
>>>> The "%s" format specifier can take char *, unsigned char *, or
>>>> signed char *. That's quite a mouthful, so "array of character
>>>> type" is used as shorthand.
>>>
>>> The depth of your understanding truly defies my
>>> ability to describe it.
>>
>> [...]
>
> The point is *not* to correct any specific mistake of Malcolm McLean>
> but to persuade him to stop taking part in discussions in-between
> High Priesthood.
> Which I consider not a bad advice.
I guess I should say something, considering the deluge of
downstream traffic my posting has precipitated.
Malcolm has wacky ideas. Surely he must know by now that other
people think his ideas are wacky -- my comment is nowhere near the
first to suggest wackiness in one way or another. Furthermore it
doesn't seem to bother or offend him that people express such
reactions. It was not my intention to insult Malcolm. I expected
he wouldn't react much one way or the other no matter what I said.
What I wrote was written mainly out of a sense of frustration:
frustration at not being able to have any really productive dialog
with Malcolm, despite years of trying.
As for some (not all) other folks who joined the conversation after
the fact, I find their behavior extremely much more offensive than
my comment to Malcolm, even if had been meant to be insulting.
To already5chosen@yahoo.com - I appreciate your comment, as
an effort to take the conversation in a positive direction.