public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [RFA] Fix compilation warnings in irix-core.c
@ 2005-03-29  4:32 Joel Brobecker
  2005-03-29  4:59 ` Daniel Jacobowitz
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Joel Brobecker @ 2005-03-29  4:32 UTC (permalink / raw)
  To: binutils

[-- Attachment #1: Type: text/plain, Size: 960 bytes --]

Hello,

GDB currently fails to build on mips/irix due to warnings now being
turned into errors. I am unfortunately lacking the time to look deeply
into this at the moment (I have asked one of my coworkers to help me
with that), but there was one file where the fixes were I think obvious.
Here is a patch for it:

2005-03-28  Joel Brobecker  <brobecker@adacore.com>

        * irix-core.c (do_sections): Add parenthesis in expression
        to avoid a compiler warning.
        (irix_core_core_file_matches_executable_p): Add ATTRIBUTE_UNUSED
        to unused parameters to avoid a compiler warning.

The changes should be nops. The only question I had was regarding
the conversion to ISO C (ie have "int foo (char *bar) {" instead of
"int foo (bar) char * bar; {"). For now, I just left the file as is.
I think the conversion should be done in a patch of its own anyway.

Tested by building GDB and running the GDB testsuite.
OK to apply?

Thanks,
-- 
Joel

[-- Attachment #2: irix-core.c.diff --]
[-- Type: text/plain, Size: 847 bytes --]

Index: irix-core.c
===================================================================
RCS file: /cvs/src/src/bfd/irix-core.c,v
retrieving revision 1.12
diff -u -p -r1.12 irix-core.c
--- irix-core.c	24 Jun 2004 04:46:24 -0000	1.12
+++ irix-core.c	28 Mar 2005 22:38:23 -0000
@@ -152,7 +152,7 @@ do_sections (abfd, coreout)
 	continue;
 
       if (!make_bfd_asection (abfd, secname,
-			      SEC_ALLOC | SEC_LOAD+SEC_HAS_CONTENTS,
+			      SEC_ALLOC | (SEC_LOAD+SEC_HAS_CONTENTS),
 			      vmap.v_len, vmap.v_vaddr, vmap.v_offset))
 	/* Fail.  */
 	return 0;
@@ -288,7 +288,7 @@ irix_core_core_file_failing_signal (abfd
 
 static bfd_boolean
 irix_core_core_file_matches_executable_p (core_bfd, exec_bfd)
-     bfd *core_bfd, *exec_bfd;
+     bfd *core_bfd ATTRIBUTE_UNUSED, *exec_bfd ATTRIBUTE_UNUSED;
 {
   return TRUE;			/* XXX - FIXME */
 }

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [RFA] Fix compilation warnings in irix-core.c
  2005-03-29  4:32 [RFA] Fix compilation warnings in irix-core.c Joel Brobecker
@ 2005-03-29  4:59 ` Daniel Jacobowitz
  2005-03-29  5:11 ` Thiemo Seufer
  2005-03-29  6:03 ` Eric Christopher
  2 siblings, 0 replies; 7+ messages in thread
From: Daniel Jacobowitz @ 2005-03-29  4:59 UTC (permalink / raw)
  To: Joel Brobecker; +Cc: binutils

On Mon, Mar 28, 2005 at 02:44:44PM -0800, Joel Brobecker wrote:
> Hello,
> 
> GDB currently fails to build on mips/irix due to warnings now being
> turned into errors. I am unfortunately lacking the time to look deeply
> into this at the moment (I have asked one of my coworkers to help me
> with that), but there was one file where the fixes were I think obvious.
> Here is a patch for it:
> 
> 2005-03-28  Joel Brobecker  <brobecker@adacore.com>
> 
>         * irix-core.c (do_sections): Add parenthesis in expression
>         to avoid a compiler warning.
>         (irix_core_core_file_matches_executable_p): Add ATTRIBUTE_UNUSED
>         to unused parameters to avoid a compiler warning.
> 
> The changes should be nops. The only question I had was regarding
> the conversion to ISO C (ie have "int foo (char *bar) {" instead of
> "int foo (bar) char * bar; {"). For now, I just left the file as is.
> I think the conversion should be done in a patch of its own anyway.

I agree.

> Tested by building GDB and running the GDB testsuite.
> OK to apply?

> -			      SEC_ALLOC | SEC_LOAD+SEC_HAS_CONTENTS,

How about just changing the + to an | ?


-- 
Daniel Jacobowitz
CodeSourcery, LLC

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [RFA] Fix compilation warnings in irix-core.c
  2005-03-29  4:32 [RFA] Fix compilation warnings in irix-core.c Joel Brobecker
  2005-03-29  4:59 ` Daniel Jacobowitz
@ 2005-03-29  5:11 ` Thiemo Seufer
  2005-03-29  6:03 ` Eric Christopher
  2 siblings, 0 replies; 7+ messages in thread
From: Thiemo Seufer @ 2005-03-29  5:11 UTC (permalink / raw)
  To: binutils

Joel Brobecker wrote:
> Hello,
> 
> GDB currently fails to build on mips/irix due to warnings now being
> turned into errors. I am unfortunately lacking the time to look deeply
> into this at the moment (I have asked one of my coworkers to help me
> with that), but there was one file where the fixes were I think obvious.
> Here is a patch for it:
> 
> 2005-03-28  Joel Brobecker  <brobecker@adacore.com>
> 
>         * irix-core.c (do_sections): Add parenthesis in expression
>         to avoid a compiler warning.
>         (irix_core_core_file_matches_executable_p): Add ATTRIBUTE_UNUSED
>         to unused parameters to avoid a compiler warning.
> 
> The changes should be nops. The only question I had was regarding
> the conversion to ISO C (ie have "int foo (char *bar) {" instead of
> "int foo (bar) char * bar; {"). For now, I just left the file as is.
> I think the conversion should be done in a patch of its own anyway.
> 
> Tested by building GDB and running the GDB testsuite.
> OK to apply?
> 
> Thanks,
> -- 
> Joel

> Index: irix-core.c
> ===================================================================
> RCS file: /cvs/src/src/bfd/irix-core.c,v
> retrieving revision 1.12
> diff -u -p -r1.12 irix-core.c
> --- irix-core.c	24 Jun 2004 04:46:24 -0000	1.12
> +++ irix-core.c	28 Mar 2005 22:38:23 -0000
> @@ -152,7 +152,7 @@ do_sections (abfd, coreout)
>  	continue;
>  
>        if (!make_bfd_asection (abfd, secname,
> -			      SEC_ALLOC | SEC_LOAD+SEC_HAS_CONTENTS,
> +			      SEC_ALLOC | (SEC_LOAD+SEC_HAS_CONTENTS),
>  			      vmap.v_len, vmap.v_vaddr, vmap.v_offset))

This should probably be SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS anyways.


Thiemo

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [RFA] Fix compilation warnings in irix-core.c
  2005-03-29  4:32 [RFA] Fix compilation warnings in irix-core.c Joel Brobecker
  2005-03-29  4:59 ` Daniel Jacobowitz
  2005-03-29  5:11 ` Thiemo Seufer
@ 2005-03-29  6:03 ` Eric Christopher
  2005-03-29  6:19   ` Joel Brobecker
  2 siblings, 1 reply; 7+ messages in thread
From: Eric Christopher @ 2005-03-29  6:03 UTC (permalink / raw)
  To: Joel Brobecker; +Cc: binutils

On Mon, 2005-03-28 at 14:44 -0800, Joel Brobecker wrote:
> Hello,
> 
> GDB currently fails to build on mips/irix due to warnings now being
> turned into errors. I am unfortunately lacking the time to look deeply
> into this at the moment (I have asked one of my coworkers to help me
> with that), but there was one file where the fixes were I think obvious.
> Here is a patch for it:
> 
> 2005-03-28  Joel Brobecker  <brobecker@adacore.com>
> 
>         * irix-core.c (do_sections): Add parenthesis in expression
>         to avoid a compiler warning.
>         (irix_core_core_file_matches_executable_p): Add ATTRIBUTE_UNUSED
>         to unused parameters to avoid a compiler warning.


 
       if (!make_bfd_asection (abfd, secname,
-			      SEC_ALLOC | SEC_LOAD+SEC_HAS_CONTENTS,
+			      SEC_ALLOC | (SEC_LOAD+SEC_HAS_CONTENTS),

Spaces around the + please.

 irix_core_core_file_matches_executable_p (core_bfd, exec_bfd)
-     bfd *core_bfd, *exec_bfd;
+     bfd *core_bfd ATTRIBUTE_UNUSED, *exec_bfd ATTRIBUTE_UNUSED;

Can you move this to:

bfd *core_bfd ATTRIBUTE_UNUSED;
bfd *exec_bfd ATTRIBUTE_UNUSED;

please?

OK with those changes. Though if you want to migrate the whole file to
ISO I'd appreciate it. For style just look at, say, elfxx-mips.c :)

-eric

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [RFA] Fix compilation warnings in irix-core.c
  2005-03-29  6:03 ` Eric Christopher
@ 2005-03-29  6:19   ` Joel Brobecker
  2005-03-29  6:29     ` Eric Christopher
  0 siblings, 1 reply; 7+ messages in thread
From: Joel Brobecker @ 2005-03-29  6:19 UTC (permalink / raw)
  To: Eric Christopher; +Cc: binutils

> > 2005-03-28  Joel Brobecker  <brobecker@adacore.com>
> > 
> >         * irix-core.c (do_sections): Add parenthesis in expression
> >         to avoid a compiler warning.
> >         (irix_core_core_file_matches_executable_p): Add ATTRIBUTE_UNUSED
> >         to unused parameters to avoid a compiler warning.
> 
> 
>  
>        if (!make_bfd_asection (abfd, secname,
> -			      SEC_ALLOC | SEC_LOAD+SEC_HAS_CONTENTS,
> +			      SEC_ALLOC | (SEC_LOAD+SEC_HAS_CONTENTS),
> 
> Spaces around the + please.

Daniel and Thiemo suggested changing the + into a |. I will make that
change and test that, if you agree.

>  irix_core_core_file_matches_executable_p (core_bfd, exec_bfd)
> -     bfd *core_bfd, *exec_bfd;
> +     bfd *core_bfd ATTRIBUTE_UNUSED, *exec_bfd ATTRIBUTE_UNUSED;
> 
> Can you move this to:
> 
> bfd *core_bfd ATTRIBUTE_UNUSED;
> bfd *exec_bfd ATTRIBUTE_UNUSED;
> 
> please?

Sure.

> OK with those changes. Though if you want to migrate the whole file to
> ISO I'd appreciate it. For style just look at, say, elfxx-mips.c :)

Sure. I'll try to do that today.

Thanks all three of you for the light-speed reviews.
-- 
Joel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [RFA] Fix compilation warnings in irix-core.c
  2005-03-29  6:19   ` Joel Brobecker
@ 2005-03-29  6:29     ` Eric Christopher
  2005-03-29  8:31       ` Joel Brobecker
  0 siblings, 1 reply; 7+ messages in thread
From: Eric Christopher @ 2005-03-29  6:29 UTC (permalink / raw)
  To: Joel Brobecker; +Cc: binutils


> > Spaces around the + please.
> 
> Daniel and Thiemo suggested changing the + into a |. I will make that
> change and test that, if you agree.
> 

I do. Don't forget the spacing :)

> >  irix_core_core_file_matches_executable_p (core_bfd, exec_bfd)
> > -     bfd *core_bfd, *exec_bfd;
> > +     bfd *core_bfd ATTRIBUTE_UNUSED, *exec_bfd ATTRIBUTE_UNUSED;
> > 
> > Can you move this to:
> > 
> > bfd *core_bfd ATTRIBUTE_UNUSED;
> > bfd *exec_bfd ATTRIBUTE_UNUSED;
> > 
> > please?
> 
> Sure.
> 
> > OK with those changes. Though if you want to migrate the whole file to
> > ISO I'd appreciate it. For style just look at, say, elfxx-mips.c :)
> 
> Sure. I'll try to do that today.
> 

Excellent.

-eric

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [RFA] Fix compilation warnings in irix-core.c
  2005-03-29  6:29     ` Eric Christopher
@ 2005-03-29  8:31       ` Joel Brobecker
  0 siblings, 0 replies; 7+ messages in thread
From: Joel Brobecker @ 2005-03-29  8:31 UTC (permalink / raw)
  To: Eric Christopher; +Cc: binutils

[-- Attachment #1: Type: text/plain, Size: 417 bytes --]

Here is what I just checked in:

2005-03-28  Joel Brobecker  <brobecker@adacore.com>

        * irix-core.c (do_sections): Replace + by | in expression.
        (irix_core_core_file_matches_executable_p): Add ATTRIBUTE_UNUSED
        to unused parameters to avoid a compiler warning.

Tested on mips-irix by running the GDB testsuite. I got identical
results, as expected.

Next is ISO-ification...

Thanks,
-- 
Joel

[-- Attachment #2: irix-core.c.diff --]
[-- Type: text/plain, Size: 857 bytes --]

Index: irix-core.c
===================================================================
RCS file: /cvs/src/src/bfd/irix-core.c,v
retrieving revision 1.12
diff -u -p -r1.12 irix-core.c
--- irix-core.c	24 Jun 2004 04:46:24 -0000	1.12
+++ irix-core.c	29 Mar 2005 04:17:38 -0000
@@ -152,7 +152,7 @@ do_sections (abfd, coreout)
 	continue;
 
       if (!make_bfd_asection (abfd, secname,
-			      SEC_ALLOC | SEC_LOAD+SEC_HAS_CONTENTS,
+			      SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS,
 			      vmap.v_len, vmap.v_vaddr, vmap.v_offset))
 	/* Fail.  */
 	return 0;
@@ -288,7 +288,8 @@ irix_core_core_file_failing_signal (abfd
 
 static bfd_boolean
 irix_core_core_file_matches_executable_p (core_bfd, exec_bfd)
-     bfd *core_bfd, *exec_bfd;
+     bfd *core_bfd ATTRIBUTE_UNUSED;
+     bfd *exec_bfd ATTRIBUTE_UNUSED;
 {
   return TRUE;			/* XXX - FIXME */
 }

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2005-03-29  4:21 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-03-29  4:32 [RFA] Fix compilation warnings in irix-core.c Joel Brobecker
2005-03-29  4:59 ` Daniel Jacobowitz
2005-03-29  5:11 ` Thiemo Seufer
2005-03-29  6:03 ` Eric Christopher
2005-03-29  6:19   ` Joel Brobecker
2005-03-29  6:29     ` Eric Christopher
2005-03-29  8:31       ` Joel Brobecker

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).