Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!uunet!oresoft!dan From: dan@oresoft.uu.net (Daniel Elbaum) Newsgroups: comp.std.c Subject: Re: Zero Length Arrays Allowed? Message-ID: <1989Dec4.191942.4331@oresoft.uu.net> Date: 4 Dec 89 19:19:42 GMT References: <2299@jato.Jpl.Nasa.Gov> Reply-To: dan@oresoft.uu.net (Daniel Elbaum) Organization: Oregon Software, Portland, OR Lines: 22 In article <2299@jato.Jpl.Nasa.Gov> baalke@mars.jpl.nasa.gov (Ron Baalke) writes :I've inherited some C code that had the following declaration in it: : : char tbi[0]; : :When I tried to compile this using Turbo C v2.0 and VAX C, it was flagged as :a fatal error. My question is this: are zero length arrays allowed in the :ANSI standard for C? No. The intent of the original coder would most likely be satisified by char tbi[]; /* incomplete type; size to be filled in later */ or char tbi[1]; /* maybe at the end of a structure template */ . -- The disbelievers say: "Lo! This is a mere wizard." -Quran, Surah X ({uunet,tektronix,reed,sun!nosun,osu-cis,psu-cs}!oresoft!(dan)@oresoft.uu.net)