bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

unicase: fix unportable use of bit-fields


From: Bruno Haible
Subject: unicase: fix unportable use of bit-fields
Date: Tue, 7 Apr 2009 04:07:43 +0200
User-agent: KMail/1.9.9

The 'int' type is signed - except in bit fields, where it is platform dependent
whether 'int x : 7' defines a signed or unsigned bit field. Solaris cc,
AIX xlc, and OSF/1 cc all interpret it as unsigned.

The workaround is to always use the keyword 'signed' or 'unsigned' in
bit-fields.


2009-04-06  Bruno Haible  <address@hidden>

        Fix unportable use of bit-fields.
        * lib/unicase/special-casing.h (struct special_casing_rule): Change the
        bit-field type from 'int' to 'signed int'. Otherwise Solaris cc,
        AIX xlc, and OSF/1 cc interpret it as 'unsigned int'.

--- lib/unicase/special-casing.h.orig   2009-04-07 04:03:36.000000000 +0200
+++ lib/unicase/special-casing.h        2009-04-07 04:00:48.000000000 +0200
@@ -38,7 +38,7 @@
   /*bool*/ unsigned int has_next : 1;
 
   /* Context.  */
-  int context : 7;
+  signed int context : 7;
 
   /* Language, or an empty string.  */
   char language[2];




reply via email to

[Prev in Thread] Current Thread [Next in Thread]