From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28529 invoked by alias); 9 Feb 2007 12:25:02 -0000 Received: (qmail 28463 invoked by uid 22791); 9 Feb 2007 12:25:01 -0000 X-Spam-Check-By: sourceware.org Received: from tamu-relay.tamu.edu (HELO tr-1-int.cis.tamu.edu) (165.91.22.121) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 09 Feb 2007 12:24:55 +0000 Received: from localhost (localhost.tamu.edu [127.0.0.1]) by tr-1-int.cis.tamu.edu (Postfix) with ESMTP id 57E5915205 for ; Fri, 9 Feb 2007 06:24:54 -0600 (CST) Received: from postal.cs.tamu.edu (mailhost.cs.tamu.edu [128.194.138.100]) by tr-1-int.cis.tamu.edu (Postfix) with ESMTP id 0750515045; Fri, 9 Feb 2007 06:24:52 -0600 (CST) Received: from soliton.cs.tamu.edu (vpn-10.cs.tamu.edu [128.194.150.10]) by postal.cs.tamu.edu (Postfix) with ESMTP id B457346DE01; Fri, 9 Feb 2007 06:24:52 -0600 (CST) Received: by soliton.cs.tamu.edu (Postfix, from userid 1000) id 1E87B1AA37; Fri, 9 Feb 2007 06:24:53 -0600 (CST) To: gdb-patches@sourceware.org Cc: dan@codesourcery.com Subject: PATCH to gdb/ada-lang.c From: Gabriel Dos Reis Date: Fri, 09 Feb 2007 12:25:00 -0000 Message-ID: <8764ab4iy2.fsf@soliton.cs.tamu.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2007-02/txt/msg00120.txt.bz2 This patch is prompted by a build failure /home/gdr/redhat/src/gdb/ada-lang.c: In function 'ada_lookup_symbol_list': /home/gdr/redhat/src/gdb/ada-lang.c:4659: warning: passing argument 3 of 'remove_out_of_scope_renamings' discards qualifiers from pointer target type with SVN GCC and CVS GDB. The real issue is a bug in GCC, reported here http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30743 However, looking at the code, it appears that the function remove_out_of_scope_renamings does not modify the object pointed to by its thirs parameter. Consequently the third parameter type should be a pointer to const struct block. That removes the "need" for a cast in ada_lookup_symbol_list. OK? -- Gaby 2007-02-09 Gabriel Dos Reis * ada-lang.c (remove_out_of_scope_renamings): Change third parameter's type to a pointer to const struct block. (ada_lookup_symbol_list): Don't cast away constness when calling remove_out_of_scope_renamings. Index: ada-lang.c =================================================================== RCS file: /cvs/src/src/gdb/ada-lang.c,v retrieving revision 1.92 diff -p -r1.92 ada-lang.c *** ada-lang.c 26 Jan 2007 21:31:05 -0000 1.92 --- ada-lang.c 9 Feb 2007 12:00:33 -0000 *************** renaming_is_visible (const struct symbol *** 4419,4425 **** static int remove_out_of_scope_renamings (struct ada_symbol_info *syms, ! int nsyms, struct block *current_block) { struct symbol *current_function; char *current_function_name; --- 4419,4425 ---- static int remove_out_of_scope_renamings (struct ada_symbol_info *syms, ! int nsyms, const struct block *current_block) { struct symbol *current_function; char *current_function_name; *************** done: *** 4656,4663 **** cache_symbol (name0, namespace, (*results)[0].sym, (*results)[0].block, (*results)[0].symtab); ! ndefns = remove_out_of_scope_renamings (*results, ndefns, ! (struct block *) block0); return ndefns; } --- 4656,4662 ---- cache_symbol (name0, namespace, (*results)[0].sym, (*results)[0].block, (*results)[0].symtab); ! ndefns = remove_out_of_scope_renamings (*results, ndefns, block0); return ndefns; }