From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27529 invoked by alias); 1 Jan 2011 15:42:42 -0000 Received: (qmail 27521 invoked by uid 22791); 1 Jan 2011 15:42:41 -0000 X-SWARE-Spam-Status: No, hits=-2.9 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 01 Jan 2011 15:42:36 +0000 From: "rogi at linuxmail dot org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/47143] warning about const multidimensional array as function parameter X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: rogi at linuxmail dot org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Status Resolution Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Date: Sat, 01 Jan 2011 15:42:00 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2011-01/txt/msg00026.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47143 Igor changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |UNCONFIRMED Resolution|INVALID | --- Comment #5 from Igor 2011-01-01 15:42:34 UTC --- (In reply to comment #4) > If you want to use const here only on the callee side then you will need to use > casts. I meant what I said: you are passing "pointer to array[4] of double", > with no const in there, to a function expecting "pointer to array[4] of const > double", and this is not a case permitted by C99 6.5.16.1#1. C does not have a > type "pointer to const array[4] of double". Let me see if I understood. const double a[4][4] will become a "pointer to array of consts". So when i call my function passing a "pointer to array", teh conversion fails since it's only allowed to apply teh qualifier (const) to teh _pointer type_, which is an array, and not to it's elements as teh function was expecting. Correct me if I'm wrong again please and thanks for your patience.