Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!samsung!aplcen!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: <11751@smoke.BRL.MIL> Date: 6 Dec 89 15:16:33 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> Reply-To: gwyn@brl.arpa (Doug Gwyn) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 28 In article <11963@phoenix.Princeton.EDU> tbrakitz@phoenix.Princeton.EDU (Triantaphyllos Byron Rakitzis) writes: -Bill Wells says: ->... some systems might take that [1] declaration ->seriously and give you an error when you access something beyond ->the first element of the string. The kind that immediately comes ->to mind is debugging interpreters: these, one hopes, will check ->for accessing outside the bounds of an array. -Wait, hold on a second. If an implementation of C does bounds checking -then it isn't C any more. Wrong. -That's not how C works. There's no such thing as an array in C. -Just pointers, and memory. Wrong. -It's up to the system to do segementation protection, if it wants. Not relevant. Just because you aren't familiar with an implementation like Bill described does not mean they don't exist or that they're not valid C implementations. I use the [1] kludge on occasion, but I raise flags when I do because it is not guaranteed to work. It happens to, on all the systems I commonly have access to.