Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Gabriel Dos Reis <gdr@cs.tamu.edu>
To: gdb-patches@sourceware.org
Cc: dan@codesourcery.com
Subject: PATCH to gdb/ada-lang.c
Date: Fri, 09 Feb 2007 12:25:00 -0000	[thread overview]
Message-ID: <8764ab4iy2.fsf@soliton.cs.tamu.edu> (raw)


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  <gdr@integrable-solutions.net>

	* 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;
  }


             reply	other threads:[~2007-02-09 12:25 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-09 12:25 Gabriel Dos Reis [this message]
2007-02-09 20:24 ` Joel Brobecker
2007-02-09 20:25   ` Daniel Jacobowitz
2007-02-09 20:46     ` Gabriel Dos Reis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8764ab4iy2.fsf@soliton.cs.tamu.edu \
    --to=gdr@cs.tamu.edu \
    --cc=dan@codesourcery.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox