Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site decvax.UUCP Path: utzoo!watmath!clyde!akgua!mcnc!decvax!minow From: minow@decvax.UUCP (Martin Minow) Newsgroups: net.lang.c Subject: return expr and Decus-C Message-ID: <478@decvax.UUCP> Date: Fri, 4-May-84 17:59:52 EDT Article-I.D.: decvax.478 Posted: Fri May 4 17:59:52 1984 Date-Received: Sat, 5-May-84 07:33:05 EDT Organization: DEC UNIX Engineering Group Lines: 30 Previously, on net.lang.c, the following was stated: 1. Decus C does not support "return expression;" where the expression is not enclosed in parentheses. 2. Decus C predates Kernighan and Ritchie, where the parentheses were shown as optional. 3. Version 6 Unix C compilers accepted this syntax before before of Kernighan and Ritchie. These statements are true. However, Decus C was coded using the Unix Version 6 reference manual, where the only valid forms for the return statement were return and return ( expression ) Since the person who wrote Decus C did not have access to the source code for Unix C, he had no way of knowing that the syntax accepted by the compiler did not agree with the reference manual. We have not bothered to change Decus C as we feel that we would be legitimizing a poor programming practice. The change to the compiler, which is very simple, is left as a exercise for the student. Martin Minow decvax!minow