public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* PATCH: use unsigned int :1 bitfield
@ 2006-05-02  3:43 Ben Elliston
  2006-05-02  4:07 ` Alan Modra
  0 siblings, 1 reply; 2+ messages in thread
From: Ben Elliston @ 2006-05-02  3:43 UTC (permalink / raw)
  To: binutils

Another patch hanging around in my checkout.  It's best to qualify one
bit wide bitfields as unsigned.  I believe the C standard leaves the
exact range of values for a signed :1 field up to the
implementation--am I right?

Okay for mainline?

2006-05-02  Ben Elliston  <bje@au.ibm.com>

	* config/obj-elf.h (ELF_TARGET_SYMBOL_FIELDS): Make single bit
	field unsigned.

Index: config/obj-elf.h
===================================================================
RCS file: /cvs/src/src/gas/config/obj-elf.h,v
retrieving revision 1.28
diff -u -p -r1.28 obj-elf.h
--- config/obj-elf.h    20 Sep 2005 18:24:45 -0000      1.28
+++ config/obj-elf.h    2 May 2006 03:39:25 -0000
@@ -83,7 +83,7 @@ struct elf_obj_sy
 #define OBJ_SYMFIELD_TYPE struct elf_obj_sy
 
 /* Symbol fields used by the ELF back end.  */
-#define ELF_TARGET_SYMBOL_FIELDS int local:1;
+#define ELF_TARGET_SYMBOL_FIELDS unsigned int local:1;
 
 /* Don't change this; change ELF_TARGET_SYMBOL_FIELDS instead.  */
 #ifndef TARGET_SYMBOL_FIELDS

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

* Re: PATCH: use unsigned int :1 bitfield
  2006-05-02  3:43 PATCH: use unsigned int :1 bitfield Ben Elliston
@ 2006-05-02  4:07 ` Alan Modra
  0 siblings, 0 replies; 2+ messages in thread
From: Alan Modra @ 2006-05-02  4:07 UTC (permalink / raw)
  To: Ben Elliston; +Cc: binutils

On Tue, May 02, 2006 at 01:44:47PM +1000, Ben Elliston wrote:
> Another patch hanging around in my checkout.  It's best to qualify one
> bit wide bitfields as unsigned.  I believe the C standard leaves the
> exact range of values for a signed :1 field up to the
> implementation--am I right?

Yes, according to my copy.

> 	* config/obj-elf.h (ELF_TARGET_SYMBOL_FIELDS): Make single bit
> 	field unsigned.

OK.

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre

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

end of thread, other threads:[~2006-05-02  4:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-05-02  3:43 PATCH: use unsigned int :1 bitfield Ben Elliston
2006-05-02  4:07 ` Alan Modra

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