unions and volatile qualifiers

Kevin Braunsdorf ksb at j.cc.purdue.edu
Sun Apr 10 04:26:15 AEST 1988


-------

All the members of this union should be tagged as being volatile.

	union {
		int oi;
		char oc;
	} u;
	int *pi;

	pi = & u.oi;			/* should be a comment || warning */

You see why they cannot be ordinary in the union?

Another case:
	union {
		noalias int ei;		/* should be a comment || warning */
		char oops;
	} u2;

the int is not exclusive in the union, it cannot be.

Do we all agree that a volatile is needed here (in unions)?

I'll discuss this through mail with anyone who cares.

kayessbee		pur-ee!ksb	ksb at j.cc.purdue.edu



More information about the Comp.lang.c mailing list