rfg@MCC.COM (Ron Guilmette) (03/20/89)
(I am cross posting this to bug-gcc and bug-g++ since it seems to affect
both compilers).
I just now learned about "unnamed" structure fields. Somebody on the
net mentioned them so I looked them up in my December 7, 1988 ANSI-C
draft standard.
I like the idea, but the ANSI syntax requires that unnamed fields can only
be bit-fields, not normal fields! It would make more sense to me allow either,
but that's ANSI for you!
Anyway, GCC (1.33) and G++ (1.34.1) allow either, but even when the
-pedantic switch is used, neither compiler generates an error or warning
when unnamed field are non-bit-fields, as in the example below:
struct s {
int a;
int ; /* ERROR: unnamed field is not a bit field */
int b;
};
// Ron Guilmette - MCC - Experimental (parallel) Systems Kit Project
// 3500 West Balcones Center Drive, Austin, TX 78759 - (512)338-3740
// ARPA: rfg@mcc.com
// UUCP: {rutgers,uunet,gatech,ames,pyramid}!cs.utexas.edu!pp!rfg