From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22366 invoked by alias); 11 Jul 2002 12:06:04 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 22286 invoked by uid 71); 11 Jul 2002 12:06:02 -0000 Resent-Date: 11 Jul 2002 12:06:02 -0000 Resent-Message-ID: <20020711120602.22283.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-To: nobody@gcc.gnu.org Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org Resent-Reply-To: gcc-gnats@gcc.gnu.org, send2pradeep@yahoo.com Received: (qmail 21904 invoked by uid 61); 11 Jul 2002 12:02:55 -0000 Message-Id: <20020711120255.21903.qmail@sources.redhat.com> Date: Thu, 11 Jul 2002 05:06:00 -0000 From: send2pradeep@yahoo.com Reply-To: send2pradeep@yahoo.com To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version: gnatsweb-2.9.3 (1.1.1.1.2.31) Subject: c/7273: having problem with pointer to pointer with const in function calling X-SW-Source: 2002-07/txt/msg00324.txt.bz2 List-Id: >Number: 7273 >Category: c >Synopsis: having problem with pointer to pointer with const in function calling >Confidential: no >Severity: non-critical >Priority: low >Responsible: unassigned >State: open >Class: rejects-legal >Submitter-Id: net >Arrival-Date: Thu Jul 11 05:06:02 PDT 2002 >Closed-Date: >Last-Modified: >Originator: Pradeep S >Release: gcc 2.95.3 suse linux 7.2 build >Organization: >Environment: suse linux 7.2 >Description: i have a function of following kind. Which means to my understanding, ppi is a pointer to pointer to constant integer. ie (**ppi cannot be modified). void func(const int **ppi) { } i tried to call this function like this int main() { int **ppi; //some initialization of ppi stuff func(ppi); return 1; } when i compile this, i am getting a warning, which i feel wrong. it says argument has pointer type mismatch. i am passing a modifiable data to a function which will not modify the data(hence const, in the hope that in future it may be passed some constant, which does happen in my code). can u tell a scenario in which this can lead to disaster? so, what does the warning signify? similarly when formal argument is of type int *const **pppi; and actual argument is of type int ***pppi; it says a warning. but it didnot say anything when formal argument is int *const *ppi and actual argument is int **ppi what is the diff in above three cases that causes first two to throw a warning while third compiled quitely? am i bugging u too much? >How-To-Repeat: not appilcaple >Fix: >Release-Note: >Audit-Trail: >Unformatted: