Path: utzoo!attcan!uunet!mcsun!hp4nl!star.cs.vu.nl!eck From: eck@cs.vu.nl (Hans van Eck) Newsgroups: comp.std.c Subject: Re: are arrays allowed in strictly conforming programs? Message-ID: <7951@star.cs.vu.nl> Date: 15 Oct 90 07:58:11 GMT References: <7913@star.cs.vu.nl> <14138@smoke.BRL.MIL> Sender: news@cs.vu.nl Lines: 23 gwyn@smoke.BRL.MIL (Doug Gwyn) writes: >In article <7913@star.cs.vu.nl> eck@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@cs.vu.nl