🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #5557

Re: volatile registers

#5557
From: Chris Torek
Date: Fri, 06 Jan 1989 05:20
22 lines
1491 bytes
>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
Technical Details
Message-ID: <15315@mimsy.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!lll-winken!lll-ncis!helios.ee.lbl.gov!pasteur!ames!ncar!tank!mimsy!chris
References: <141@bms-at.UUCP> <275@twwells.uucp> <15166@mimsy.UUCP> <1103@houxs.ATT.COM>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!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