Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!clyde!rutgers!seismo!mcvax!ukc!warwick!cudcv From: cudcv@warwick.UUCP Newsgroups: comp.lang.c++ Subject: C intermediate from void functions Message-ID: <343@sol.warwick.ac.uk> Date: Mon, 27-Apr-87 12:37:33 EDT Article-I.D.: sol.343 Posted: Mon Apr 27 12:37:33 1987 Date-Received: Thu, 30-Apr-87 01:55:40 EDT Reply-To: cudcv@sol.warwick.ac.uk (Rob McMahon) Organization: Computing Services, Warwick University, UK Lines: 53 I've just put C++ release 1.2 up on our Gould running UTX 1.2 (BSD Unix with bits of System V thrown in). This went with barely a hitch, but during the build the compiler issues hundreds of warnings like "simpl.c", line 1098: warning: function has a declared type but never returns a value It turns out the noddy file --- c.c --- void func() { ; } ----------- produces the intermediate --- c..c --- /* <> */ /* < c.c */ char *_new(); char _delete(); char *_vec_new(); char _vec_delete(); char func () { ; } ; /* the end */ ------------ which when compiled with 'CC +i -c c.c' produces --- CC c.c: cc -c c..c "c..c", line 10: warning: function has a declared type but never returns a value --- Now my question. Why does the void get changed into char ? This seems a very strange choice. I know some compilers aren't very good with void's, so it might make sense not to leave it as void, but if you're going to change it surely the obvious choice would be int (as in 1.1, and about which the Gould compiler doesn't complain). Any offers ? -- UUCP: ...!mcvax!ukc!warwick!cudcv PHONE: +44 203 523037 JANET: cudcv@uk.ac.warwick.daisy ARPA: cudcv@daisy.warwick.ac.uk Rob McMahon, Computing Services, Warwick University, Coventry CV4 7AL, England