Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!purdue!haven!adm!smoke!gwyn From: gwyn@smoke.BRL.MIL (Doug Gwyn) Newsgroups: comp.lang.c Subject: Re: Zero Length Arrays Allowed in C Standard? Message-ID: <11759@smoke.BRL.MIL> Date: 6 Dec 89 20:20:49 GMT References: <2298@jato.Jpl.Nasa.Gov> <11715@smoke.BRL.MIL> <480@codonics.COM> <1989Dec2.210042.12668@twwells.com> <8129@cg-atla.UUCP> <1989Dec5.112553.24087@twwells.com> <11963@phoenix.Princeton.EDU> <8141@cg-atla.UUCP> Reply-To: gwyn@brl.arpa (Doug Gwyn) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 19 In article <8141@cg-atla.UUCP> fredex@cg-atla.UUCP (Fred Smith) writes: -One reason that comes to mind is a conflict with the way arrays -relate to pointers. For normal arrays, simply mentioning its name -in a program evaluates to the address of the array. Now what is this -address?? It is the address of the first element of the array! If -the thing is declared as zero length, what do you get when you -mention its address ?? I dunno, haven't tried it yet (I intend to), -but I bet it makes no sense, whatever it is! It makes perfect sense. -Even if it does evaluate to some address somewhere, it certainly is -not an address at which one would dare to store data This is no different from usual -- you're not allowed to store beyond the bounds of ANY array. The main problem is that two distinct 0-length objects might have the same address. This bothers some people.