🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by Ron Guilmette Sun, 19 Mar 1989 21:31
anonymous non-bit-field fields
#1761
Author: Ron Guilmette
Date: Sun, 19 Mar 1989 21:31
26 lines
1333 bytes
(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
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads