I see that you don't know what "e.g." means. STRINGSIZE is the appropriate 
condition for assignment. It is not the appropriate condition for SUBSTR; 
STRINGRANGE. For that matter, neither is the correct condition for an array of 
strings, SUBSCRIPTRANGE is. Any of the three would have been appropriate after 
the "e.g.".

I would recommend enabling all three, but then I'm paranoid. YMMV.


--
Shmuel (Seymour J.) Metz
http://mason.gmu.edu/~smetz3

________________________________________
From: IBM Mainframe Discussion List [[email protected]] on behalf of 
Robin Vowels [[email protected]]
Sent: Wednesday, March 30, 2022 11:54 AM
To: [email protected]
Subject: Re: PL/I

On 2022-03-31 01:42, Seymour J Metz wrote:
> However, buffer overruns are characteristic of languages with no range
> checking. Of course, you can write C in PL/I with, e.g,
> (NOSTRINGRANGE) prefixes.

No, the appropriate condition is STRINGSIZE.
And that is disabled by default.
STRINGRANGE is disabled by default also.

It is always recommended to enable the STRINGSIZE condition.

> ________________________________________
> From: IBM Mainframe Discussion List <[email protected]> on
> behalf of Paul Gilmartin
> Sent: Wednesday, March 30, 2022 10:31 AM
> Subject: Re: PL/I question
>
> On Wed, 30 Mar 2022 14:53:57 +0100, Rupert Reynolds wrote:
>
>> That's a common problem, certainly, but if we include the wider world
>> of
>> micros and minis, I'd bet that buffer overuns related to
>> null-teminated
>> strings (BLEAH!) are in the lead :-)
>>
> Buffer overruns are hardly peculiar to null-temniated strinigs.
> Rather,
> they result from indolent programmers' neglecting to check the length
> before the move or the status after; using strcat() and sprinitf()
> instead of strncat and snprintf(); etc.
>
> What should be done in HLASM?  Use unprotected MVCL, or define
> data types with explicit lengths and rely on macros to move data with
> protection?
>
> Should an attempted buffer overrun throw an exception?

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to