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: Fri, 27 Mar 2020 19:58:32 -0700
Organization: A noiseless patient Spider
Lines: 27
Message-ID: <867dz589t3.fsf@linuxsc.com>
References: <87muaodqqn.fsf@bsb.me.uk> <87zhencyud.fsf@bsb.me.uk> <1by2u7s456.fsf@pfeifferfamily.net> <87o8v3cg0i.fsf@bsb.me.uk> <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>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Info: reader02.eternal-september.org; posting-host="ba68f15be103986af77012e457fe73de"; logging-data="24887"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/UrafY6emdQcYlxOLlKhCvnf6IdMsYwkc="
User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux)
Cancel-Lock: sha1:3f67JKNLSNJTaXNxxtrPEABPiyw= sha1:ufgD2/nMB6ttFndTHP3IumpTHWQ=
Xref: csiph.com comp.lang.c:150867
Keith Thompson writes:
> Tim Rentsch writes:
> [...]
>
>>>> Keith Thompson writes:
>>>
>>> [...]
>>>
>>>>> A pointer to a string *is* required for a "%s" directive, but the
>>>>> standard says so only indirectly.
>
> [...]
>
>> I need to add though that 'char' is not really accurate. The Standard
>> says "character type" and I think it means that, not just 'char'.
>> Furthermore if an 'l' length modifier is present then the array
>> elements are assumed to be of type 'wchar_t'. Both the regular
>> character types and wchar_t fall under the common umbrella of
>> "character type".
>
> When I wrote "%s" directive, I meant "%s" directive.
Sorry, I thought we were talking about things the Standard
actually discusses. The Standard makes no statements about
'"%s" directives', unless you want to count examples that
happen to have a %s as part of a format string.