unions and volatile qualifiers

00704a-Liber nevin1 at ihlpf.ATT.COM
Tue Apr 12 11:32:14 AEST 1988


In article <6891 at j.cc.purdue.edu> ksb at j.cc.purdue.edu.UUCP (Kevin Braunsdorf) writes:
|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?

No.  What volatile means is that something besides this program can modify
this variable (such as a hardware interrupt, signal handler, etc.).
-- 
 _ __			NEVIN J. LIBER	..!ihnp4!ihlpf!nevin1	(312) 510-6194
' )  )				"The secret compartment of my ring I fill
 /  / _ , __o  ____		 with an Underdog super-energy pill."
/  (_</_\/ <__/ / <_	These are solely MY opinions, not AT&T's, blah blah blah



More information about the Comp.lang.c mailing list