Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!rice!rice!sun-spots-request From: gbarker@mph.sm.ucl.ac.uk (Dr Gareth J. Barker) Newsgroups: comp.sys.sun Subject: exit() and return() in a C program Keywords: Miscellaneous Message-ID: <1173.9008080908@mph.sm.ucl.ac.uk> Date: 8 Aug 90 09:08:02 GMT Sender: sun-spots-request@rice.edu Organization: Sun-Spots Lines: 42 Approved: Sun-Spots@rice.edu Originator: spots@titan.rice.edu X-Sun-Spots-Digest: Volume 9, Issue 298, message 11 Can somebody explain to me what the lint message below means? titan% cat test.c main() { } titan% lint test.c test.c(3): warning: main() returns random value to invocation environment titan% titan% cat test1.c void exit(); main() { exit(0); } titan% lint test1.c test.c(6): warning: main() returns random value to invocation environment Replacing exit by return makes lint happy. titan% cat test2.c main() { return(0); } titan% lint test2.c titan% Is lint just trying to tell me that any function, including main, must have at least one 'normal' return? Is this a new feature in 4.1, I don't remember seeing this before? -- Gareth J. Barker, Institute of Neurology, Queen Square, London, UK. JANET : gbarker@uk.ac.ucl.sm.mph INTERNET : gbarker@.mph.sm.ucl.ac.uk BITNET : gbarker%uk.ac.ucl.sm.mph@ukacrl.bitnet