Subject: Incorrect specification of bit field

From: [email-masked]
Date: Thu, 13 Jan 2000 07:52:58 -0600 (CST)

Full_Name: Jakob Schiøtz
Version: 2.2.4
CVS_Date: 
OS: AIX 4.1.5
X_Server: 
Submission from: (NULL) (130.225.86.6)

When compiling fvwm 2.2.4 using the AIX xlc compiler, it chokes on the
following declaration in menus.h (around line 80), and on other bit field
declarations in the same file:

typedef struct MenuFeel {
    struct
    {
      unsigned char Animated : 1;
      unsigned char PopupImmediately : 1;
      unsigned char TitleWarp : 1;
    } f;
    int PopupOffsetPercent;
    int PopupOffsetAdd;
} MenuFeel;

It requires that a bit field is declared as int, unsigned int or signed
int.

If the compiler is invoked as cc instead of xlc it considers it a
recoverable error, and compiles it as if the declaration had been unsigned

int.  I checked in Kernighan & Richie, they specify that an "int" datatype
must be used, so I think this should be considered an error in fvwm2: 
"Fields may be declared only as ints; for portability, specify signed or
unsigned explicitly" (Kernighan and Rirchie, 2nd edition (1988) page 150).

I assume that I could have compiled without problems using gcc, but my
experience indicates that on this platform the native compiler generates
faster code.

Best regards,

Jakob Schiøtz, Department of Physics, Technical University of Denmark.

--
Visit the official FVWM web page at <URL:http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [email-masked].
To report problems, send mail to [email-masked]