Path: utzoo!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!mcsun!ukc!dcl-cs!gdt!gdr!exspes From: exspes@gdr.bath.ac.uk (P E Smee) Newsgroups: comp.lang.c Subject: Re: Compilers and programming style (was Re: A question of style) Message-ID: <1990Jan5.100438.27123@gdt.bath.ac.uk> Date: 5 Jan 90 10:04:38 GMT References: <1989Dec22.100135.2903@gdt.bath.ac.uk> <4367@rtech.rtech.com> <1989Dec31.153241.16479@gdt.bath.ac.uk> <649@codonics.COM> <15065@bfmny0.UU.NET> Reply-To: exspes@gdr.bath.ac.uk (P E Smee) Organization: University of Bristol c/o University of Bath Lines: 20 In article <15065@bfmny0.UU.NET> tneff@bfmny0.UU.NET (Tom Neff) writes: >If you have a specialized systems/hardware-type situation where merely >referring to a variable has useful side effects, then you can cast it >to (void) or some such, to make this obvious. Otherwise, it's probably >a coding error and lint should catch it. True, always best to leave flags for whoever has to maintain your code next. (If you're unlucky, it might even be you. :-) A useful use of (void) casts. I also like to use '/* nobreak; */' statements when I want a switch case to fall through. >The issue of how much of lint's work the c compiler ought to do is a >separate one. My humble opinion is none at all, unless the compiler has a -switch which allows you to ask for it, and you've used the switch. -- Paul Smee, Univ of Bristol Comp Centre, Bristol BS8 1TW, Tel +44 272 303132 Smee@bristol.ac.uk :-) (..!uunet!ukc!gdr.bath.ac.uk!exspes if you MUST)