src/bfd ChangeLog bfd.c
brobecke@sourceware.org
brobecke@sourceware.org
Thu May 9 06:58:00 GMT 2013
CVSROOT: /cvs/src
Module name: src
Changes by: brobecke@sourceware.org 2013-05-09 06:58:17
Modified files:
bfd : ChangeLog bfd.c
Log message:
Use fputc in place of putc to avoid -Wunused-value warning (AIX).
Currently, bfd does not compile with -Wunused-value because
the following code:
val = putc ('\n', f);
gets expanded into some code that triggers a warning:
warning: value computed is not used [-Wunused-value]
This is because putc is implemented as a macro...
>#define putc(__x, __p) (((!((__p)->_flag & 0xC000)) && \
> ((__p)->_flag = ((__p)->_flag & 0x3FFF) | 0x8000)),\
> (--(__p)->_cnt < 0 ? \
> __flsbuf((unsigned char) (__x), (__p)) : \
> (int) (*(__p)->_ptr++ = (unsigned char) (__x))))
It's the first part, before the coma operator, which triggers
the unused-value warning.
This patch fixes the issue by simply avoiding the macro and using
fputc instead.
bfd/ChangeLog:
* bfd.c (_bfd_default_error_handler): Replace use of putc
by fputc. Add comment explaining why.
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/src/bfd/ChangeLog.diff?cvsroot=src&r1=1.6053&r2=1.6054
http://sourceware.org/cgi-bin/cvsweb.cgi/src/bfd/bfd.c.diff?cvsroot=src&r1=1.126&r2=1.127
More information about the Binutils-cvs
mailing list