This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Implement C11 annex K?


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]