Path: utzoo!mnetor!uunet!lll-winken!lll-lcc!ames!mailrus!tut.cis.ohio-state.edu!osu-cis!att-cb!att-ih!ihnp4!ihlpf!nevin1 From: nevin1@ihlpf.ATT.COM (00704a-Liber) Newsgroups: comp.lang.c Subject: Re: unions and volatile qualifiers Message-ID: <4384@ihlpf.ATT.COM> Date: 12 Apr 88 01:32:14 GMT References: <12578@brl-adm.ARPA> <6891@j.cc.purdue.edu> Reply-To: nevin1@ihlpf.UUCP (00704a-Liber,N.J.) Distribution: na Organization: AT&T Bell Laboratories - Naperville, Illinois Lines: 19 Keywords: volatile and the union In article <6891@j.cc.purdue.edu> ksb@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." / (_