From owner-freebsd-alpha Fri Dec 8 13: 0:36 2000 From owner-freebsd-alpha@FreeBSD.ORG Fri Dec 8 13:00:34 2000 Return-Path: Delivered-To: freebsd-alpha@freebsd.org Received: from mass.osd.bsdi.com (adsl-63-202-176-64.dsl.snfc21.pacbell.net [63.202.176.64]) by hub.freebsd.org (Postfix) with ESMTP id EC29437B400; Fri, 8 Dec 2000 13:00:33 -0800 (PST) Received: from mass.osd.bsdi.com (localhost [127.0.0.1]) by mass.osd.bsdi.com (8.11.0/8.11.1) with ESMTP id eB8L9vF02129; Fri, 8 Dec 2000 13:09:57 -0800 (PST) (envelope-from msmith@mass.osd.bsdi.com) Message-Id: <200012082109.eB8L9vF02129@mass.osd.bsdi.com> X-Mailer: exmh version 2.1.1 10/15/1999 To: wpaul@FreeBSD.ORG (Bill Paul) Cc: wkb@freebie.demon.nl (Wilko Bulte), jhb@FreeBSD.ORG, alpha@FreeBSD.ORG Subject: Re: cvs commit: src/sys/alpha/conf GENERIC In-reply-to: Your message of "Fri, 08 Dec 2000 12:56:02 PST." <20001208205603.C401D37B404@hub.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Fri, 08 Dec 2000 13:09:57 -0800 From: Mike Smith Sender: msmith@mass.osd.bsdi.com Sender: owner-freebsd-alpha@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org > While looking over the code, something jumped out at me. In > epic_common_attach(), we have this: > > i = sizeof(struct epic_frag_list)*TX_RING_SIZE + > sizeof(struct epic_rx_desc)*RX_RING_SIZE + > sizeof(struct epic_tx_desc)*TX_RING_SIZE + PAGE_SIZE, > sc->pool = (epic_softc_t *) malloc( i, M_DEVBUF, M_NOWAIT); > > There are two C statements here: one to assign a value to i, and another > to malloc() i bytes worth of space and leave the address of the buffer > in sc->pool. Except the first statement doesn't end with a semicolon. > > How is this not a syntax error? Because there's a comma between the two statements. i = 10, j = malloc(i); is a legal expression which returns 10. The comma operator really only exists for things like for (i = 0, j = 0; ... but you do find it abused occasionally by someone that thinks they're being smart or funny. -- ... every activity meets with opposition, everyone who acts has his rivals and unfortunately opponents also. But not because people want to be opponents, rather because the tasks and relationships force people to take different points of view. [Dr. Fritz Todt] V I C T O R Y N O T V E N G E A N C E To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-alpha" in the body of the message