Date: Sun, 25 Oct 1998 03:53:45 +0000 (GMT) From: George Foot To: djgpp AT delorie DOT com Subject: Re: construction has been delayed due to somebody's stupidity (most likely my own) In-Reply-To: <36329321.21F4ACAD@montana.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com On Sat, 24 Oct 1998, bowman wrote: > It is interesting that one can declare a function returning MyClass, > never define or > use it, and the compiler never says a word, while it will emit warnings > for used > variables. I know little C++, but in C external-scope functions aren't warned about, because the compiler can't know that they're not called from another file. If you make them static and use the appropriate warning options ("-Wall -O" does it I think) then it will warn you about this. Same for static variables, but not externs. You referred above to automatic variables, I think. -Wstrict-prototypes, -Wmissing-prototypes and -Wmissing-declarations can be useful too it you like that sort of thing (I do in non-trivial programs). The latter two in particular notify you when you forgot to declare a (external-scope) function or variable in a header file. -- george DOT foot AT merton DOT oxford DOT ac DOT uk xu do tavla fo la lojban -- http://xiron.pc.helsinki.fi/lojban/lojban.html