Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!rutgers!seismo!mcnc!rti-sel!dg_rtp!throopw From: throopw@dg_rtp.UUCP Newsgroups: comp.lang.c Subject: Re: Auto variable with sizeof == 0 Message-ID: <994@dg_rtp.UUCP> Date: Fri, 6-Feb-87 17:19:43 EST Article-I.D.: dg_rtp.994 Posted: Fri Feb 6 17:19:43 1987 Date-Received: Sun, 8-Feb-87 04:57:42 EST References: <4114@brl-adm.ARPA> <5258@mimsy.UUCP> Lines: 27 Summary: I agree with Chris, with a small additional nit > chris@mimsy.UUCP (Chris Torek) >> escott%deis.uci.edu@icsg.uci.edu (Scott Menter) >>... is there any reason why you should be able to declare an array >>with zero elements as an automatic variable? > Why not? It makes sense. [...] > some argue in favour of `catching the programmer's > mistakes for him', while others argue that the construct may not > be a mistake, or may have been written by a machine, and that having > special cases for zero is both unnecessary and ugly. This is sensible, I agree. But it is worth noting that int foo[0]; and int foo[]; are NOT the same thing. Even if X3J11 were to take the reasonable approach and allow the first as an automatic declaration, the second should still be an error as an automatic declaration. -- IBM manuals are written by little old ladies in Poughkeepsie who are instructed to say nothing specific. --- R. T. Lillington -- Wayne Throop !mcnc!rti-sel!dg_rtp!throopw