are arrays allowed in strictly conforming programs?
Hans van Eck
eck at cs.vu.nl
Mon Oct 15 17:58:11 AEST 1990
gwyn at smoke.BRL.MIL (Doug Gwyn) writes:
>In article <7913 at star.cs.vu.nl> eck at cs.vu.nl (Hans van Eck) writes:
>>If an array is accessed beyond the end of *an* object, the behavior is
>>undefined. (emphasis mine)
>The
>larger context is that some of the 4.11 functions could be requested to
>operate on nonexistent objects, for example
> int src[3], dst[10];
> memcpy(dst, src, 10);
>Instead of posting a warning in each function's subsection, the
>injunction against attempting such abuse is posted in the blanket section.
I am not completely convinced. The point was that the standard talks about
*an* object. It doesn't say that the object meant is the last element of
the array.
Hans
--
Hans van Eck, Dept. of Mathematics and Computer Science, Vrije Universiteit,
De Boelelaan 1081, 1081 HV Amsterdam, The Netherlands
Voice: +31 20 5485302 Email: eck at cs.vu.nl
More information about the Comp.std.c
mailing list