* PATCH to gdb/ada-lang.c
@ 2007-02-09 12:25 Gabriel Dos Reis
2007-02-09 20:24 ` Joel Brobecker
0 siblings, 1 reply; 4+ messages in thread
From: Gabriel Dos Reis @ 2007-02-09 12:25 UTC (permalink / raw)
To: gdb-patches; +Cc: dan
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;
}
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: PATCH to gdb/ada-lang.c
2007-02-09 12:25 PATCH to gdb/ada-lang.c Gabriel Dos Reis
@ 2007-02-09 20:24 ` Joel Brobecker
2007-02-09 20:25 ` Daniel Jacobowitz
0 siblings, 1 reply; 4+ messages in thread
From: Joel Brobecker @ 2007-02-09 20:24 UTC (permalink / raw)
To: Gabriel Dos Reis; +Cc: gdb-patches, dan
Hello Gaby,
Thanks for your patch.
> 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.
I had a look, and although I cannot approve your change, I agree
with your conclusions and your patch.
--
Joel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: PATCH to gdb/ada-lang.c
2007-02-09 20:24 ` Joel Brobecker
@ 2007-02-09 20:25 ` Daniel Jacobowitz
2007-02-09 20:46 ` Gabriel Dos Reis
0 siblings, 1 reply; 4+ messages in thread
From: Daniel Jacobowitz @ 2007-02-09 20:25 UTC (permalink / raw)
To: Joel Brobecker; +Cc: Gabriel Dos Reis, gdb-patches
On Fri, Feb 09, 2007 at 12:25:27PM -0800, Joel Brobecker wrote:
> Hello Gaby,
>
> Thanks for your patch.
>
> > 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.
>
> I had a look, and although I cannot approve your change, I agree
> with your conclusions and your patch.
Good enough for me; is OK.
--
Daniel Jacobowitz
CodeSourcery
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: PATCH to gdb/ada-lang.c
2007-02-09 20:25 ` Daniel Jacobowitz
@ 2007-02-09 20:46 ` Gabriel Dos Reis
0 siblings, 0 replies; 4+ messages in thread
From: Gabriel Dos Reis @ 2007-02-09 20:46 UTC (permalink / raw)
To: Daniel Jacobowitz; +Cc: Joel Brobecker, gdb-patches
On Fri, 9 Feb 2007, Daniel Jacobowitz wrote:
| On Fri, Feb 09, 2007 at 12:25:27PM -0800, Joel Brobecker wrote:
| > Hello Gaby,
| >
| > Thanks for your patch.
| >
| > > 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.
| >
| > I had a look, and although I cannot approve your change, I agree
| > with your conclusions and your patch.
|
| Good enough for me; is OK.
Many thanks to all of you.
-- Gaby
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2007-02-09 20:46 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-02-09 12:25 PATCH to gdb/ada-lang.c Gabriel Dos Reis
2007-02-09 20:24 ` Joel Brobecker
2007-02-09 20:25 ` Daniel Jacobowitz
2007-02-09 20:46 ` Gabriel Dos Reis
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox