Path: utzoo!mnetor!uunet!husc6!necntc!ima!haddock!karl From: karl@haddock.ISC.COM (Karl Heuer) Newsgroups: comp.lang.c Subject: Re: volatile Message-ID: <3237@haddock.ISC.COM> Date: 30 Mar 88 18:16:49 GMT References: <12578@brl-adm.ARPA> <1988Mar25.172355.348@utzoo.uucp> <588@imagine.PAWL.RPI.EDU> <1988Mar29.004454.2867@utzoo.uucp> <134@wyse.wyse.com> Reply-To: karl@haddock.ima.isc.com (Karl Heuer) Organization: Interactive Systems, Boston Lines: 21 In article <134@wyse.wyse.com> mikew@wyse.UUCP (Mike Wexler) writes: >In article <1988Mar29.004454.2867@utzoo.uucp> henry@utzoo.uucp (Henry Spencer) writes: >>the sort of code we're talking about isn't portable anyway. >I would disagree that is isn't possible to write portable code that requires >volatiles. An example(possibly the only one), is the use of System V >or Berkeley shared memory. Why drag shared memory into it? Isn't the following an example of a strictly conforming program that needs volatile? #include static sig_atomic_t volatile gotcha; static void catch(int signo) { gotcha = 1; } int main(void) { (void)signal(SIGINT, catch); gotcha = 0; do; while (!gotcha); return (0); } Karl W. Z. Heuer (ima!haddock!karl or karl@haddock.isc.com), The Walking Lint