This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: h8300-rtems: error: left shift of negative value
- From: Nicholas Clifton <nickc at redhat dot com>
- To: Jan-Benedict Glaw <jbglaw at lug-owl dot de>, binutils at sourceware dot org
- Cc: Jeff Law <law at redhat dot com>
- Date: Thu, 04 Jun 2015 16:28:01 +0100
- Subject: Re: h8300-rtems: error: left shift of negative value
- Authentication-results: sourceware.org; auth=none
- References: <20150604142756 dot GH7864 at lug-owl dot de>
Hi Jan-Benedict,
gcc -DHAVE_CONFIG_H -I. -I../../binutils-gdb/gas -I. -I../../binutils-gdb/gas -I../bfd -I../../binutils-gdb/gas/config -I../../binutils-gdb/gas/../include -I../../binutils-gdb/gas/.. -I../../binutils-gdb/gas/../bfd -DLOCALEDIR="\"/home/jbglaw/src/toolchain/install/share/locale\"" -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Werror -I../../binutils-gdb/gas/../zlib -g -O2 -MT tc-h8300.o -MD -MP -MF .deps/tc-h8300.Tpo -c -o tc-h8300.o `test -f 'config/tc-h8300.c' || echo '../../binutils-gdb/gas/'`config/tc-h8300.c
../../binutils-gdb/gas/config/tc-h8300.c: In function âmd_section_alignâ:
../../binutils-gdb/gas/config/tc-h8300.c:2259:43: error: left shift of negative value [-Werror=shift-negative-value]
return ((size + (1 << align) - 1) & (-1 << align));
I have checked in the patch below to fix this.
Cheers
Nick
gas/ChangeLog
2015-06-04 Nick Clifton <nickc@redhat.com>
* config/tc-h8300.c (md_section_align): Fix compile time warning
about left shifting a negative value.
diff -u -3 -p -r1.124 tc-h8300.c
--- gas/config/tc-h8300.c 15 Mar 2015 13:03:06 -0000 1.124
+++ gas/config/tc-h8300.c 4 Jun 2015 15:24:01 -0000
@@ -2256,7 +2256,7 @@ valueT
md_section_align (segT segment, valueT size)
{
int align = bfd_get_section_alignment (stdoutput, segment);
- return ((size + (1 << align) - 1) & (-1 << align));
+ return ((size + (1 << align) - 1) & (-1U << align));
}
void