Path: utzoo!utgpu!watmath!clyde!att!ulysses!ggs From: ggs@ulysses.homer.nj.att.com (Griff Smith) Newsgroups: comp.lang.c Subject: Re: const, volatile, etc Summary: what do I do about old code? Message-ID: <10929@ulysses.homer.nj.att.com> Date: 2 Dec 88 20:52:53 GMT References: <674@quintus.UUCP> <117@halcdc.UUCP> <468@auspex.UUCP> <9033@smoke.BRL.MIL> Organization: AT&T Bell Laboratories, Murray Hill Lines: 38 In article <9033@smoke.BRL.MIL>, gwyn@smoke.BRL.MIL (Doug Gwyn ) writes: > In article <10919@ulysses.homer.nj.att.com> ggs@ulysses.homer.nj.att.com (Griff Smith) writes: | ... > >The response I got from a C++ guru around here wasn't encouraging: he > >suggested declaring everything volatile and ignoring the issue. > > Maybe he was joking? Could be, but he seemed serious. This was in response to a question about bug search and destroy missions directed toward existing working code. I think the implication was that fixing old code to work with new compilers is boring; just sweep the problem under the rug and be done with it. Do it right when you write something new. > >Maybe he's right, but that attitude could easily lead to a habit of > >forcing all declarations to include the volatile qualifier just to > >avoid a `silly' rule. | > No, that's not the proper way to use "volatile". I know that. The point was that `some' variable needed to be declared volatile, and it was easier to fix them all rather than find the right one using reasoning. > >Do any of you have some practical experience, plus suggestions for > >living in the brave new ANSI-C world? | > I have a "standard C language assist" filethat I configure > for each system I port to, and that I include in each source file of > my applications. Good start. Now, what do I do about upgrading a million lines of old code to the new standard, and finding all the mis-declared variables. -- Griff Smith AT&T (Bell Laboratories), Murray Hill Phone: 1-201-582-7736 UUCP: {most AT&T sites}!ulysses!ggs Internet: ggs@ulysses.att.com