Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!hellgate.utah.edu!cs.utexas.edu!uunet!yale!mfci!karzes From: karzes@mfci.UUCP (Tom Karzes) Newsgroups: comp.lang.c Subject: Re: type *var -- vs. -- type* var Message-ID: <1014@m3.mfci.UUCP> Date: 11 Sep 89 19:41:27 GMT References: <4201@ohstpy.mps.ohio-state.edu> <29048@news.Think.COM> <12813@pur-ee.UUCP> <10992@smoke.BRL.MIL> Sender: karzes@mfci.UUCP Reply-To: karzes@mfci.UUCP (Tom Karzes) Organization: Multiflow Computer Inc., Branford Ct. 06405 Lines: 28 In article <10992@smoke.BRL.MIL> gwyn@brl.arpa (Doug Gwyn) writes: >In article <12813@pur-ee.UUCP> lewie@ecn-ee.UUCP writes: >>Because there's no explicit separator between declarations and statements, >>you'll never be able to declare pointers as such. Isn't C syntax fun? > >I don't know what you're talking about; do you? I don't think you were paying close enough attention to this discussion. Yes, he knows what he's talking about. His point was that if the following is seen in a routine (amidst declarations): (int *) x, y, z; then it will be parsed as a comma expression and the (int *) would be parsed as a cast. It certainly won't serve as a declaration of three pointers to ints, which is what was desired. Furthermore, because it is already legal syntax for an expression, and because the parser would have no way of knowing when the declaration section of a block has ended until it sees a statement (this is what he meant about no explicit separator), he is pointing out that C could not be compatibly extended to accept this syntax for declarations. Hence, you'll never be able to declare pointers as such (using the above syntax). >Anyone who programs in C frequently declares pointers as such. This statement is a nonsequitur. C programmers do frequently declare pointers to ints, but they certainly don't use the above syntax to do so, which is what you unwittingly claimed.