Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!tut.cis.ohio-state.edu!zaphod.mps.ohio-state.edu!brutus.cs.uiuc.edu!apple!oliveb!amdahl!rtech!mikes@rtech.UUCP From: mikes@rtech.UUCP (Mike Schilling) Newsgroups: comp.lang.c Subject: Re: Compilers and programming style (was Re: A question of style) Message-ID: <4367@rtech.rtech.com> Date: 23 Dec 89 18:38:25 GMT References: <1989Dec22.100135.2903@gdt.bath.ac.uk> Sender: news@rtech.rtech.com Lines: 19 From article <1989Dec22.100135.2903@gdt.bath.ac.uk>, by exspes@gdr.bath.ac.uk (P E Smee): > A compiler should *never* of its own choice put out gratuitous warnings > about valid constructs, as many places will not allow release of code > unless it compiles with NO messages at all; and because a compiler which > forces you to ignore chatty messages will someday lead you to miss an > important one. How about this: sub() { extern void (*ptr)(); *ptr; /* Should be (*ptr)(), of course */ } This is legal c, but almost certainly *not* what was intended. Most compilers I've used don't flag this as an error, or even a warning. In fact, there was a posting in comp.lang.c yesterday by someone who did this, and couldn't figure out why his function wasn't being called. Isn't a chatty message in order?