This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [RFA/Semi-obvious/5.3?] Fix compilation error in hppa-tdep.c
- From: Elena Zannoni <ezannoni at redhat dot com>
- To: Joel Brobecker <brobecker at gnat dot com>
- Cc: gdb-patches at sources dot redhat dot com
- Date: Wed, 30 Oct 2002 10:08:58 -0500
- Subject: Re: [RFA/Semi-obvious/5.3?] Fix compilation error in hppa-tdep.c
- References: <20021030080837.GY903@gnat.com><20021030082803.GA903@gnat.com>
Joel Brobecker writes:
> > 2002-10-30 Joel Brobecker <brobecker@gnat.com>
> >
> > * hppa-tdep.c (find_function_in_inferior): Fix the declaration
> > that caused a compilation error on HP/UX.
> > (low_text_segment_addres): Fix a compilation warning.
>
> Actually, I am replying to myself: the fix to find_function_in_inferior
> works, but is pretty stupid. Better to remove the extern altogether,
> since we get the definition directly from value.h (which caused the
> compilation error in the first place).
>
Yes, externs in .c files are flagged by the ARI, and should be removed
whenever one gets a chance. Are the Makefile dependencies on value.h in place?
(I always ask, I didn't check).
Seems ok to me.
Thanks for taking upon yourself the hppa cleanup task. It is really great news!
Elena
> Sorry about that, I should not be working that late I suppose.
>
> Here is a new patch, with a new ChangeLog:
>
> 2002-10-30 Joel Brobecker <brobecker@gnat.com>
>
> * hppa-tdep.c (find_function_in_inferior): Remove this extern,
> as this is already provided by value.h, and was actually causing
> a compilation error due to a conflict in parameter type declaration
> due to a missing const keyword.
> (low_text_segment_addres): Fix a compilation warning.
>
> It looks like the 5.3 branch has the same problem, so I'll fix it too
> when I get approval for this patch.
>
> Thanks,
> --
> Joel
> Index: hppa-tdep.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/hppa-tdep.c,v
> retrieving revision 1.28
> diff -c -3 -p -r1.28 hppa-tdep.c
> *** hppa-tdep.c 24 Oct 2002 21:02:53 -0000 1.28
> --- hppa-tdep.c 30 Oct 2002 08:24:34 -0000
> *************** extern int hp_som_som_object_present;
> *** 149,157 ****
> /* In breakpoint.c */
> extern int exception_catchpoints_are_fragile;
>
> - /* This is defined in valops.c. */
> - extern struct value *find_function_in_inferior (char *);
> -
> /* Should call_function allocate stack space for a struct return? */
> int
> hppa_use_struct_convention (int gcc_p, struct type *type)
> --- 149,154 ----
> *************** static CORE_ADDR low_text_segment_addres
> *** 300,306 ****
> static void
> record_text_segment_lowaddr (bfd *abfd, asection *section, void *ignored)
> {
> ! if ((section->flags & (SEC_ALLOC | SEC_LOAD | SEC_READONLY)
> == (SEC_ALLOC | SEC_LOAD | SEC_READONLY))
> && section->vma < low_text_segment_address)
> low_text_segment_address = section->vma;
> --- 297,303 ----
> static void
> record_text_segment_lowaddr (bfd *abfd, asection *section, void *ignored)
> {
> ! if (((section->flags & (SEC_ALLOC | SEC_LOAD | SEC_READONLY))
> == (SEC_ALLOC | SEC_LOAD | SEC_READONLY))
> && section->vma < low_text_segment_address)
> low_text_segment_address = section->vma;