Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site ucbvax.ARPA Path: utzoo!watmath!clyde!cbosgd!ucbvax!info-vax From: info-vax@ucbvax.ARPA Newsgroups: fa.info-vax Subject: Re: Possible VAX/VMS PL/I bug Message-ID: <4843@ucbvax.ARPA> Date: Thu, 14-Feb-85 22:27:37 EST Article-I.D.: ucbvax.4843 Posted: Thu Feb 14 22:27:37 1985 Date-Received: Fri, 15-Feb-85 06:10:52 EST Sender: daemon@ucbvax.ARPA Organization: University of California at Berkeley Lines: 51 From: Jerry Bakin Thanks Roger, that is exactly how I feel. I have been told my many people to turn off warnings, but the fact is I want the warnings, it is just that I want them to be meaningful statements about possible errors in my code, not congratulations for correctly using a language feature. To be more specific, in reference to the bug I complained of, it clearly states on page 225 of the VAX-11 PL/I Encyclopedic Reference manual, and on pages 194-197 of the Programming in VAX-11 PL/I manual that the value specified in the "return" statement will be converted (if necessary) to the type specified by the "returns" descriptor. Of course an implicit conversion took place, the language is DEFINED this way! Indeed, the return statement should be viewed as a generic conversion routine specifically because it can be asked to convert data for many different entry points! Just because its format is not return_and_convert, does not mean that the programmer does know the value will be converted. One of the main forces behind PL/I was to give the programmer freedom in these regards, the language is supposed to handle these conversions. I have also been told (by non PL/I programmers) that multiple entry points and multiple return(s) statements constitute "poor" programming practice. This alot of crap, since the presence of multiple entry points, multiple return points, and generic routines allow for the implementation of "packages". Program modularization is normally considered a "Good" programming practice. More about warnings with the VAX PL/I compiler. The example I initially ran through the compiler did indeed pick up a warning from the Multics compiler, the warning was that I had referenced a variable without its being set. This warning did not show up under VMS, instead it chose to remind me that in PL/I the return value is ALWAYS converted to the type specified by the returns descriptor. Well thanks VMS, I had wondered why I had typed that returns descriptor in in the first place! So I reject the argument that the compiler was telling me of a dubious practice, because it let go a VERY EASY TO DETECT, very dubious code through without any comment. Like I said earlier, I do not want to turn off warnings, I feel that I should be able to write a meaningful, valid program and get the compiler to accept it without ANY comment from it. ANY comment from the compiler about my code DOES imply that there is something dubious about the code. I just want the comments to be meaningful.... Jerry Bakin.