Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!uunet!zephyr.ens.tek.com!tekcrl!tekfdi!videovax!dougs From: dougs@videovax.tv.Tek.com (Doug Stevens) Newsgroups: comp.sys.ibm.pc Subject: Spurious Turbo-C warning -- how do I get around it? Keywords: Turbo-C warning Message-ID: <5554@videovax.tv.Tek.com> Date: 14 Sep 89 15:48:24 GMT Distribution: usa Organization: Tektronix TV Measurement Systems, Beaverton OR Lines: 34 I'm trying to figure out how to get around a 'feature' of Turbo-C. I like to run makes with all the warnings and errors on, but when I compile a module with this type of structure (vastly simplified to show the point): #define TRUE 1 int test(void) { while (TRUE) { return(1); } } I get this warning: tcc -w -S test.c Warning test.c 8: Function should return a value in function test even though the module DOES always return a value. I can get around it by adding a dummy return statement after the loop: #define TRUE 1 int test(void) { while (TRUE) { return(1); } return(1); } But then, this SHOULD generate a warning about unreachable code. It also wastes code space. Anyone figured out a way around this?