public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] config/tc-avr.c (md_section_align): Append UL for -1 to avoid the latest gcc's warning
@ 2015-09-05  8:06 gang.chen.5i5j
  2015-09-07 15:56 ` Nick Clifton
  0 siblings, 1 reply; 4+ messages in thread
From: gang.chen.5i5j @ 2015-09-05  8:06 UTC (permalink / raw)
  To: binutils, gdb-patches; +Cc: xili_gchen_5257, Chen Gang

From: Chen Gang <gang.chen.5i5j@gmail.com>

The related warning is:

  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="\"/upstream/release-avr32/share/locale\""  -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Werror -I../../binutils-gdb/gas/../zlib -g -O2 -MT tc-avr.o -MD -MP -MF .deps/tc-avr.Tpo -c -o tc-avr.o `test -f 'config/tc-avr.c' || echo '../../binutils-gdb/gas/'`config/tc-avr.c
../../binutils-gdb/gas/config/tc-avr.c: In function ‘md_section_align’:
../../binutils-gdb/gas/config/tc-avr.c:1233:43: error: left shift of negative value [-Werror=shift-negative-value]
     return ((addr + (1 << align) - 1) & (-1 << align));
                                             ^

2015-09-05  Chen Gang  <gang.chen.5i5j@gmail.com>

	* config/tc-avr.c (md_section_align): Append UL for -1 to avoid
	the latest gcc's warning.
---
 gas/ChangeLog       | 5 +++++
 gas/config/tc-avr.c | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/gas/ChangeLog b/gas/ChangeLog
index 2dc9742..c0fb096 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,8 @@
+2015-09-05  Chen Gang  <gang.chen.5i5j@gmail.com>
+
+	* config/tc-avr.c (md_section_align): Append UL for -1 to avoid
+	the latest gcc's warning.
+
 2015-08-27  Alan Modra  <amodra@gmail.com>
 
 	PR gas/18581
diff --git a/gas/config/tc-avr.c b/gas/config/tc-avr.c
index c69a91c..09eea48 100644
--- a/gas/config/tc-avr.c
+++ b/gas/config/tc-avr.c
@@ -1230,7 +1230,7 @@ valueT
 md_section_align (asection *seg, valueT addr)
 {
   int align = bfd_get_section_alignment (stdoutput, seg);
-  return ((addr + (1 << align) - 1) & (-1 << align));
+  return ((addr + (1 << align) - 1) & (-1UL << align));
 }
 
 /* If you define this macro, it should return the offset between the
-- 
1.9.3

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

* Re: [PATCH] config/tc-avr.c (md_section_align): Append UL for -1 to avoid the latest gcc's warning
  2015-09-05  8:06 [PATCH] config/tc-avr.c (md_section_align): Append UL for -1 to avoid the latest gcc's warning gang.chen.5i5j
@ 2015-09-07 15:56 ` Nick Clifton
       [not found]   ` <55EEE759.5050309@hotmail.com>
  0 siblings, 1 reply; 4+ messages in thread
From: Nick Clifton @ 2015-09-07 15:56 UTC (permalink / raw)
  To: gang.chen.5i5j, binutils, gdb-patches; +Cc: xili_gchen_5257

Hi Chen,

> 2015-09-05  Chen Gang<gang.chen.5i5j@gmail.com>
>
> 	* config/tc-avr.c (md_section_align): Append UL for -1 to avoid
> 	the latest gcc's warning.

Approved - please apply.

Cheers
   Nick

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

* Re: [PATCH] config/tc-avr.c (md_section_align): Append UL for -1 to avoid the latest gcc's warning
       [not found]   ` <55EEE759.5050309@hotmail.com>
@ 2015-09-08 13:47     ` Chen Gang
  0 siblings, 0 replies; 4+ messages in thread
From: Chen Gang @ 2015-09-08 13:47 UTC (permalink / raw)
  To: Nick Clifton, gang.chen.5i5j, binutils, gdb

On 9/7/15 23:56, Nick Clifton wrote:
> Hi Chen,
>
>> 2015-09-05 Chen Gang<gang.chen.5i5j@gmail.com>
>>
>> * config/tc-avr.c (md_section_align): Append UL for -1 to avoid
>> the latest gcc's warning.
>
> Approved - please apply.
>

Applied, thanks.

--
Chen Gang (陈刚)

Open, share, and attitude like air, water, and life which God blessed
 		 	   		  

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

* [PATCH] config/tc-avr.c (md_section_align): Append UL for -1 to avoid the latest gcc's warning
@ 2015-09-05 10:30 Chen Gang
  0 siblings, 0 replies; 4+ messages in thread
From: Chen Gang @ 2015-09-05 10:30 UTC (permalink / raw)
  To: binutils, gdb-patches

The related warning is:

  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="\"/upstream/release-avr32/share/locale\""  -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Werror -I../../binutils-gdb/gas/../zlib -g -O2 -MT tc-avr.o -MD -MP -MF .deps/tc-avr.Tpo -c -o tc-avr.o `test -f 'config/tc-avr.c' || echo '../../binutils-gdb/gas/'`config/tc-avr.c
../../binutils-gdb/gas/config/tc-avr.c: In function ‘md_section_align’:
../../binutils-gdb/gas/config/tc-avr.c:1233:43: error: left shift of negative value [-Werror=shift-negative-value]
     return ((addr + (1 << align) - 1) & (-1 << align));
                                             ^

2015-09-05  Chen Gang  <gang.chen.5i5j@gmail.com>

	* config/tc-avr.c (md_section_align): Append UL for -1 to avoid
	the latest gcc's warning.
---
 gas/ChangeLog       | 5 +++++
 gas/config/tc-avr.c | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/gas/ChangeLog b/gas/ChangeLog
index 2dc9742..c0fb096 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,8 @@
+2015-09-05  Chen Gang  <gang.chen.5i5j@gmail.com>
+
+	* config/tc-avr.c (md_section_align): Append UL for -1 to avoid
+	the latest gcc's warning.
+
 2015-08-27  Alan Modra  <amodra@gmail.com>
 
 	PR gas/18581
diff --git a/gas/config/tc-avr.c b/gas/config/tc-avr.c
index c69a91c..09eea48 100644
--- a/gas/config/tc-avr.c
+++ b/gas/config/tc-avr.c
@@ -1230,7 +1230,7 @@ valueT
 md_section_align (asection *seg, valueT addr)
 {
   int align = bfd_get_section_alignment (stdoutput, seg);
-  return ((addr + (1 << align) - 1) & (-1 << align));
+  return ((addr + (1 << align) - 1) & (-1UL << align));
 }
 
 /* If you define this macro, it should return the offset between the
-- 
1.9.3

 		 	   		  

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

end of thread, other threads:[~2015-09-08 13:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-05  8:06 [PATCH] config/tc-avr.c (md_section_align): Append UL for -1 to avoid the latest gcc's warning gang.chen.5i5j
2015-09-07 15:56 ` Nick Clifton
     [not found]   ` <55EEE759.5050309@hotmail.com>
2015-09-08 13:47     ` Chen Gang
2015-09-05 10:30 Chen Gang

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