public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* Error when building on AIX
@ 2012-07-30 23:00 Perry Smith
  2012-07-31  8:01 ` nick clifton
  0 siblings, 1 reply; 5+ messages in thread
From: Perry Smith @ 2012-07-30 23:00 UTC (permalink / raw)
  To: binutils

Hi Guys,

The error I'm getting is:

> /usr/work/src/binutils-2.22/bfd/bfd.c: In function '_bfd_default_error_handler':
> /usr/work/src/binutils-2.22/bfd/bfd.c:730:10: error: value computed is not used

I am building binutils-2.22 on AIX 6.1 TL07 SP03 using gcc 4.5.2.

Usually I use AIX's native 'as' and 'ld' but over the weekend I bumped into a few that suggested to try GNU's... So I am.

I can't even figure out what this message is trying to tell me.  Google didn't help.

I'm also curious to here from others who are using binutils on AIX.

Thank you,
Perry

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

* Re: Error when building on AIX
  2012-07-30 23:00 Error when building on AIX Perry Smith
@ 2012-07-31  8:01 ` nick clifton
  2012-07-31 15:16   ` Perry Smith
  0 siblings, 1 reply; 5+ messages in thread
From: nick clifton @ 2012-07-31  8:01 UTC (permalink / raw)
  To: Perry Smith; +Cc: binutils

Hi Perry,
>> /usr/work/src/binutils-2.22/bfd/bfd.c: In function '_bfd_default_error_handler':
>> /usr/work/src/binutils-2.22/bfd/bfd.c:730:10: error: value computed is not used

> I can't even figure out what this message is trying to tell me.

My guess would be that gcc is complaining that the result of calling the 
"putc" function is not being used.  In fact, I suspect that on AIX putc 
is not a function call at all, but rather a macro, and the value that 
this macro computes is not being used.

Try changing line 730 to:

   (void) putc ('\n', stderr);

If this works, please let me know and I can update the sources.

Cheers
   Nick

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

* Re: Error when building on AIX
  2012-07-31  8:01 ` nick clifton
@ 2012-07-31 15:16   ` Perry Smith
  2012-07-31 19:06     ` Peter Bergner
  0 siblings, 1 reply; 5+ messages in thread
From: Perry Smith @ 2012-07-31 15:16 UTC (permalink / raw)
  To: nick clifton; +Cc: binutils


On Jul 31, 2012, at 1:55 AM, nick clifton wrote:

> Hi Perry,
>>> /usr/work/src/binutils-2.22/bfd/bfd.c: In function '_bfd_default_error_handler':
>>> /usr/work/src/binutils-2.22/bfd/bfd.c:730:10: error: value computed is not used
> 
>> I can't even figure out what this message is trying to tell me.
> 
> My guess would be that gcc is complaining that the result of calling the "putc" function is not being used.  In fact, I suspect that on AIX putc is not a function call at all, but rather a macro, and the value that this macro computes is not being used.
> 
> Try changing line 730 to:
> 
>  (void) putc ('\n', stderr);
> 
> If this works, please let me know and I can update the sources.

First: Thank you for the reply.  Some groups don't seem interested in my AIX woes.

I found what the error was telling me later.  I had my google search too tight.  It also appears that the compile tells gcc to treat warnings as errors -- which is nice.  It gives me some extra confidence that when I get the compile done, I will have something that works.  But that was part of my confusion.  I didn't understand why such a small error would cause the compile to stop.  

I first tried the void but that didn't work.  I also tried assigning it to a local variable which did not work either.  As a quick hack, I did:

#ifdef putc
#undef putc
#endif

and that worked.  It is a macro and it is dereferencing something... I didn't really take the time to figure out what it was doing.  I won't be able to change it so I just went for the work around.

I've since progressed further with this quest -- hitting and fixing other somewhat trivial issues.  I will update with a set of diffs when I get closer to the finish line.

On my second question: anyone else out there using binutils on AIX 6.1?

Thank you again,
Perry

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

* Re: Error when building on AIX
  2012-07-31 15:16   ` Perry Smith
@ 2012-07-31 19:06     ` Peter Bergner
  0 siblings, 0 replies; 5+ messages in thread
From: Peter Bergner @ 2012-07-31 19:06 UTC (permalink / raw)
  To: Perry Smith; +Cc: nick clifton, binutils

On Tue, 31 Jul 2012 10:16:36 -0500 Perry Smith <pedzsan@gmail.com> wrote:
> I also tried assigning it to a local variable which did not work either.

I think you'll still get a unused warning/error if the local isn't used either.
In that case, I think you can mark the local variable with the unused attribute
and that should (famous last words) solve it for you.  Like:

  int __attribute__ ((__unused__)) dummy;
  ...
  dummy = putc (......);


Peter

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

* Re: Error when building on AIX
@ 2012-08-09  8:15 David Edelsohn
  0 siblings, 0 replies; 5+ messages in thread
From: David Edelsohn @ 2012-08-09  8:15 UTC (permalink / raw)
  To: Perry Smith; +Cc: binutils

>>> Perry Smith wrote:

> Usually I use AIX's native 'as' and 'ld' but over the weekend I bumped into a few that suggested to try GNU's... So I am.

Where did you see a suggetion to use GNU as?  GNU as specifically is
*not* recommended on AIX.  GNU as has not been updated for XCOFF
format since AIX 5.1/5.2 and produces incorrect, broken object files
on more recent releases of AIX.

- David

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

end of thread, other threads:[~2012-08-09  1:28 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-30 23:00 Error when building on AIX Perry Smith
2012-07-31  8:01 ` nick clifton
2012-07-31 15:16   ` Perry Smith
2012-07-31 19:06     ` Peter Bergner
2012-08-09  8:15 David Edelsohn

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).