Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!snorkelwacker!bloom-beacon!eru!luth!sunic!lth.se!E89HSE@rigel.efd.lth.se From: e89hse@rigel.efd.lth.se Newsgroups: comp.lang.c Subject: Re: prototype my function, please Message-ID: <00937C2C.8EE14680@rigel.efd.lth.se> Date: 6 Jun 90 00:40:39 GMT References: <1231@wet.UUCP> <0705@sheol.UUCP> <1990May31.135230.242@druid.uucp> <236@taumet.COM> <1990Jun2.091606.9125@druid.uucp>,<239@taumet.COM> Sender: newsuser@lth.se (LTH network news server) Reply-To: e89hse@rigel.efd.lth.se Organization: Lund Institute of Technology,Lund, Sweden Lines: 21 In article <239@taumet.COM>, steve@taumet.COM (Stephen Clamage) writes: >In article <1990Jun2.091606.9125@druid.uucp> darcy@druid.UUCP (D'Arcy J.M. Cain) writes: >> ... >>#include >>int main(int argc, char **argv) >>{ >> printf("%s has %d arguments\n", *argv, argc); >> exit(0); >>} >> >>The compiler will give a warning that a function (main) which should >>return an int does not return anything. ... >>You now have added code (which won't be optimised out) which has no other >>purpose than to shut the compiler up. ... > >Are you really concerned about one return statement in one function in >the entire program taking up code space but never being executed? But that is ugly. In most unix versions of lint at least you can put: /*NOTREACHED*/ after exit() to mark that the program never get to that point.