From owner-freebsd-chat Tue Apr 30 8:52:17 2002 Delivered-To: freebsd-chat@freebsd.org Received: from flood.ping.uio.no (flood.ping.uio.no [129.240.78.31]) by hub.freebsd.org (Postfix) with ESMTP id 8458B37B423 for ; Tue, 30 Apr 2002 08:52:09 -0700 (PDT) Received: by flood.ping.uio.no (Postfix, from userid 2602) id 3576E5346; Tue, 30 Apr 2002 17:52:07 +0200 (CEST) X-URL: http://www.ofug.org/~des/ X-Disclaimer: The views expressed in this message do not necessarily coincide with those of any organisation or company with which I am or have been affiliated. To: Francis Jordan Cc: freebsd-chat@freebsd.org Subject: Re: strange gcc warning References: <20020430132306.1282.qmail@web20405.mail.yahoo.com> From: Dag-Erling Smorgrav Date: 30 Apr 2002 17:52:06 +0200 In-Reply-To: <20020430132306.1282.qmail@web20405.mail.yahoo.com> Message-ID: Lines: 17 User-Agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/21.2 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-freebsd-chat@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org Francis Jordan writes: > This may seem like a newbie question, but still -- why > does the following produce a warning: > > void > foo(const int b[8][8]) > { > } Arrays degenerate to pointers when passed as arguments to functions. You can wrap it in a struct if you want to keep the size information; otherwise foo() will have to do the necessary pointer arithmetic "by hand". DES -- Dag-Erling Smorgrav - des@ofug.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-chat" in the body of the message