Re: Whither VMS?



Michael Kraemer <M.Kraemer@xxxxxx> wrote:
< Jordi Guillaumes i Pons schrieb:
<> En/na glen herrmannsfeldt ha escrit:

<>> < And one of the first languages that I used that had this "length byte"
<>> < concept was UCSD-Pascal. Which, from the very start, included a way
<>> < to violate those bounds. Go figure....

<>> PL/I also usually uses length at the beginning.

<> Yup! Only for VARYING CHAR variables. On the other hand, it uses
<> descriptors to pass string parameters so the called procedure knows the
<> length of the incoming string, being it fixed-length or varying.

< So does C, thanks to null termination of read-only strings.
< As for target strings, PL/I isn't any better, IMHO,
< unless the standard has changed in the past 15 years.
< They have a maximum length, if you exceed it on write, you'll
< have a buffer overflow as well. Unless you have enabled
< STRINGSIZE, of course, but this is rarely the case in
< production code. And even if it is, what do you gain?
< A production program which aborts due to STRINGSIZE raised.

I forget know whether STRINGSIZE defaults to enabled or not.
It is easy to enable if needed, either for the procedure or
by the statement. It is much more difficult in C to add the
check to a program not designed for it.

< A solution superior to C would be if PL/I allowed stuff like

< DCL AA,BB,CC CHAR(*) VAR;
< CC = AA || BB;

< with automatic (re)allocation of CC with just the right length,
< thanks to the descriptor concept.
< Wasn't possible at the time I had to leave PL/I.

Not automatic, but still probably easier than doing the right
thing in C. Deallocate if needed, allocate to length(aa)+length(bb),
assign.

<> The more recent versions support C-isms like UNION, so the need to do
<> such idioms (when you have to debug a program where one structure is
<> based on the address of the last byte of another structure, which is
<> based on a record, which is based on a POINTER, using a DUMP, you start
<> to wonder what in #??$@ was thinking the programmer about... ;)).

< You don't need unions to mess up your programs.
< The PL/I concept of BASED variables does that as well.
< You can trash just everything, including your oh-so-secure descriptors.
< I remember using this "trick" deliberately to modify the dimension
< layout of array.
< Add to that that PL/I passes arguments by reference (not by
< value, as does C), and you have another possibility of
< trashing data.

Well, arrays, strings, and structures are passed by descriptor.
It might be that VALUE has been added now for calls to C.

-- glen

.



Relevant Pages

  • Re: PL/I string representations
    ... The MODERN limit with IBM's commercial PL/I compilers is *still* ... And everyone needed strings longer than 32K, so it was a big problem? ... EGN screwed up by claiming otherwise, ... this is completely wrong and not a single PL/I programmer agrees ...
    (comp.programming)
  • Re: PL/I string representations
    ... variable strings in PL/I, 32K-1 is still the max value supported. ... than PL/I can support with the dubious feature of supporting ... How is that PL/I compiler coming along? ...
    (comp.programming)
  • Re: [Announce] FreeVMS 0.1.3
    ... but the marginal inherent safety advantage PL/I ... > seems to offer is based on descriptors, ... concerned with a variety of control blocks, ...
    (comp.os.vms)
  • Re: Latest on Windoze Navy software
    ... > I've never really understood why DEC decided to use counted strings ... just like Fortran. ... Pascal knows how to automatically build descriptors when calling ...
    (comp.os.vms)
  • Re: USB device descriptor
    ... The strings in the INF file may be independent of any strings stored on the ... device itself, so no, the descriptors of the device would not be sufficient. ... Conexant Systems, Inc. ...
    (microsoft.public.development.device.drivers)

Loading