From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26753 invoked by alias); 1 Dec 2009 00:08:24 -0000 Received: (qmail 26738 invoked by uid 22791); 1 Dec 2009 00:08:23 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from mail2.rz.fhtw-berlin.de (HELO mail2.rz.htw-berlin.de) (141.45.10.102) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 01 Dec 2009 00:08:17 +0000 Envelope-to: gcc-help@gcc.gnu.org Received: from e178065073.adsl.alicedsl.de ([85.178.65.73] helo=[192.168.178.20]) by mail2.rz.htw-berlin.de with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.68 (FreeBSD)) (envelope-from ) id 1NFGHv-000Dy7-CO for gcc-help@gcc.gnu.org; Tue, 01 Dec 2009 01:08:15 +0100 Message-ID: <4B145E6E.3010807@htw-berlin.de> Date: Tue, 01 Dec 2009 00:08:00 -0000 From: Thomas Martitz User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; de; rv:1.9.1.5) Gecko/20091121 Thunderbird/3.0 MIME-Version: 1.0 To: gcc-help@gcc.gnu.org Subject: Re: Warning when using const pointer to fixed size array References: <959717.71134.qm@web110612.mail.gq1.yahoo.com> <4B145764.8040306@htw-berlin.de> <4B145DC0.4070303@htw-berlin.de> In-Reply-To: <4B145DC0.4070303@htw-berlin.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-HTW-SPAMINFO: this message was scanned by eXpurgate (http://www.eleven.de) X-IsSubscribed: yes Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org X-SW-Source: 2009-12/txt/msg00001.txt.bz2 Am 01.12.2009 01:05, schrieb Thomas Martitz: > Am 01.12.2009 00:46, schrieb me22: >> 2009/11/30 Thomas Martitz: >>> What address are you taking? "array" already stands for the address >>> of the >>> first element (and is hence sort of a pointer). I'm not sure you can >>> take >>> the address of the array name as I think it doesn't have one. >>> >> You can, actually: >> >> int main() { >> int a[4]; >> int (*p)[4] =&a; >> } > > > I didn't try gcc, but visual studio compiler gives an error on that one. Nevermind, I just tried copy&pasting yours and it worked. I guess I used something slightly different.