Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!wuarchive!gem.mps.ohio-state.edu!ginosko!uunet!portal!cup.portal.com!Devin_E_Ben-Hur From: Devin_E_Ben-Hur@cup.portal.com Newsgroups: comp.sys.ibm.pc Subject: Re: Spurious Turbo-C warning -- how do I get around it? Message-ID: <22262@cup.portal.com> Date: 18 Sep 89 08:25:36 GMT References: <5554@videovax.tv.Tek.com> Distribution: usa Organization: The Portal System (TM) Lines: 37 > 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: [warning about no return value for function] > > Anyone figured out a way around this? Sure try: #define TRUE 1 int test(void) { while (TRUE) { break; /* or goto done; */ } /* done: */ return(1); } or add #pragma warn -rvl /* before the function end */ and #pragma warn .rvl /* after the function end */ Devin_Ben-Hur@Cup.Portal.Com ...ucbvax!sun!portal!cup.portal.com!devin_ben-hur