This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: Implement C11 annex K?
- From: "David A. Wheeler" <dwheeler at dwheeler dot com>
- To: "libc-alpha" <libc-alpha at sourceware dot org>
- Date: Sun, 17 Aug 2014 16:33:41 -0400 (EDT)
- Subject: Re: Implement C11 annex K?
- Authentication-results: sourceware.org; auth=none
- Reply-to: dwheeler at dwheeler dot com
On Sun, 17 Aug 2014 15:05:50 -0400, dalias <dalias@libc.org> wrote:
> You missed the next sentence:
>
> "If the precision is not specified or is greater than the size of the
> array, the array shall contain a null character."
That does NOT say that the reader must not read
beyond the precision; it merely specifies data constructs *within* it.
Granted, you'd *hope* the implementer would stop at the precision value,
but that is simply a hope.
> Formally there is no such thing as reading past the end of the array
> (or even indexing past the end of the array).
The spec could promise that it will not read more chars than those
given the precision when one is given. No such promise is given.
--- David A. Wheeler