Path: utzoo!attcan!uunet!lll-winken!lll-ncis!helios.ee.lbl.gov!pasteur!ames!ncar!tank!mimsy!chris From: chris@mimsy.UUCP (Chris Torek) Newsgroups: comp.std.c Subject: Re: volatile registers Keywords: volatile Message-ID: <15315@mimsy.UUCP> Date: 6 Jan 89 05:20:17 GMT References: <141@bms-at.UUCP> <275@twwells.uucp> <15166@mimsy.UUCP> <1103@houxs.ATT.COM> Organization: U of Maryland, Dept. of Computer Science, Coll. Pk., MD 20742 Lines: 22 >In article <2337@cuuxb.ATT.COM> dlm@cuuxb.ATT.COM (Dennis L. Mumaugh) writes: >>The concept "volatile" should not occur in any general C program. >>This feature exists only for the stand alone, the real time and >>the kernel hacker. In article <1103@houxs.ATT.COM> beyer@houxs.ATT.COM (J.BEYER) writes: >I disagree with this statement. >Consider a program with a global variable that can be accessed by the >'main' program and a signal handler. ... I forget whether using signal handlers and `sig_atomic_t' gives a strictly conformant program. Note, though, that in this case the variable cannot be declared `register' as it is global or static. [see subject: header] (This, and setjmp/longjmp, are probably the only two places where strictly conformant programs need the volatile qualifier. I believe that the qualifier, if present, is hidden underneath the sig_atomic_t typedef.) -- In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163) Domain: chris@mimsy.umd.edu Path: uunet!mimsy!chris