In whole-array operations, IBM's Windows compiler does not check
that arrays are compatible.
Even if SUBSCRIPTRANGE is enabled, there is no check.
Have there been any PL/I compilers that performed such a check?
On 6/5/21 12:03 AM, Robin Vowels wrote:
In whole-array operations, IBM's Windows compiler does not check
that arrays are compatible.
Even if SUBSCRIPTRANGE is enabled, there is no check.
Have there been any PL/I compilers that performed such a check?
Even the Checkout Compiler does not specifically list an ONCODE for it.
All IBM compilers going back to F specifically say that it is not
allowed, but I can find no documentation that it’s specifically checked. They may have supposed that it’s too improbable, given that any sensible user will check either file input or parameter values early on, so as to
give a meaningful diagnostic.
On 6/5/21 12:51 PM, John W Kennedy wrote:
On 6/5/21 12:03 AM, Robin Vowels wrote:
In whole-array operations, IBM's Windows compiler does not check
that arrays are compatible.
Even if SUBSCRIPTRANGE is enabled, there is no check.
Have there been any PL/I compilers that performed such a check?
Even the Checkout Compiler does not specifically list an ONCODE for
it. All IBM compilers going back to F specifically say that it is not
allowed, but I can find no documentation that it’s specifically
checked. They may have supposed that it’s too improbable, given that
any sensible user will check either file input or parameter values
early on, so as to give a meaningful diagnostic.
I learned not to count on sensible users sometime during my first
programming job!
I suppose someone could fire up "F" on Hercules to see what happens, but
in my experience IBM cut quite a few corners with the Enterprise
compilers. Some of them they fixed as they went along, but maybe not all.
On 6/5/21 12:03 AM, Robin Vowels wrote:.
In whole-array operations, IBM's Windows compiler does not check
that arrays are compatible.
Even if SUBSCRIPTRANGE is enabled, there is no check.
Have there been any PL/I compilers that performed such a check?
Even the Checkout Compiler does not specifically list an ONCODE for it..
All IBM compilers going back to F specifically say that it is not.
allowed,
but I can find no documentation that it’s specifically checked..
They may have supposed that it’s too improbable,
given that any sensible.
user will check either file input or parameter values early on, so as to give a meaningful diagnostic.
On Sunday, June 6, 2021 at 5:51:11 AM UTC+10, John W. Kennedy wrote:
On 6/5/21 12:03 AM, Robin Vowels wrote:.
In whole-array operations, IBM's Windows compiler does not check
that arrays are compatible.
Even if SUBSCRIPTRANGE is enabled, there is no check.
Have there been any PL/I compilers that performed such a check?
Even the Checkout Compiler does not specifically list an ONCODE for it..
Any condition that is raised should be the SUBSCRIPTRANGE condition,
of course.
.
All IBM compilers going back to F specifically say that it is not.
allowed,
The bounds of arrays must be identical.
.
but I can find no documentation that it’s specifically checked..
They may have supposed that it’s too improbable,
Given that the equivalent operation is spelled out in terms of
loops, one would expect that SUBSCRIPTRANGE be raised
when the equivalent code experiences a subscript out of range
for an array whose bounds do not conform.
At the very least, any bounds check ought to be carried out
once prior to executing code for the operation.
.
given that any sensible.
user will check either file input or parameter values early on, so as to
give a meaningful diagnostic.
A user would only know to include such a check if it were stated in the manual
that a check would not be carried out by the compiler. (or, if he/she discovered it by accident).
On 6/6/21 1:09 AM, Robin Vowels wrote:.
On Sunday, June 6, 2021 at 5:51:11 AM UTC+10, John W. Kennedy wrote:
On 6/5/21 12:03 AM, Robin Vowels wrote:.
In whole-array operations, IBM's Windows compiler does not check
that arrays are compatible.
Even if SUBSCRIPTRANGE is enabled, there is no check.
Have there been any PL/I compilers that performed such a check?
Even the Checkout Compiler does not specifically list an ONCODE for it..
Any condition that is raised should be the SUBSCRIPTRANGE condition,
of course.
.
All IBM compilers going back to F specifically say that it is not.
allowed,
The bounds of arrays must be identical.
.
but I can find no documentation that it’s specifically checked..
They may have supposed that it’s too improbable,
Given that the equivalent operation is spelled out in terms of
loops, one would expect that SUBSCRIPTRANGE be raised
when the equivalent code experiences a subscript out of range
for an array whose bounds do not conform.
The specification of SUBSCRIPTRANGE speaks of the evaluation of the subscript. But in an array operation, there is no subscript variable.
visible to the user.
And the object code penalty would be obscene to.
evaluate each individual case
when it can be checked by LBOUND = LBOUND.
and HBOUND = HBOUND.
As far as I can tell, IBM PL/I has worked the way.
it does now for over 50 years, so I don’t think you’ll see a change, but if you want to submit it to IBM, you’re welcome to try. And I suggest
you suggest, at least as a alternative, a new ON-condition, perhaps to
be named ARRAYRANGE or at least a new ONCODE value.
(I’m in no position.
to do it; I have 30 years of experience with PL/I on DOS/360 and OS/360
and their descendants (and a little on OS/2), but I live in the Apple
world nowadays, and am far more interested in Swift and Cocoa.
.At the very least, any bounds check ought to be carried out
once prior to executing code for the operation.
.
given that any sensible.
user will check either file input or parameter values early on, so as to >> give a meaningful diagnostic.
A user would only know to include such a check if it were stated in the manual
that a check would not be carried out by the compiler. (or, if he/she discovered it by accident).
Still smarter to do reasonableness checks first,.
so that the data error.
is expressed to the user in a user-readable form that explains that
there is an input error,
instead of a mysterious IBM error message that.
can only be interpreted by the original programmer.
In whole-array operations, IBM's Windows compiler does not check
that arrays are compatible.
Even if SUBSCRIPTRANGE is enabled, there is no check.
Have there been any PL/I compilers that performed such a check?
Robin Vowels wrote:
In whole-array operations, IBM's Windows compiler does not check
that arrays are compatible.
Even if SUBSCRIPTRANGE is enabled, there is no check.
Have there been any PL/I compilers that performed such a check?
Hi Robin,.
If you post an example we can try it with the current IBM compiler.
On Tuesday, June 8, 2021 at 4:39:58 AM UTC+10, Thomas David Rivers wrote:
Robin Vowels wrote:.
In whole-array operations, IBM's Windows compiler does not checkHi Robin,
that arrays are compatible.
Even if SUBSCRIPTRANGE is enabled, there is no check.
Have there been any PL/I compilers that performed such a check?
If you post an example we can try it with the current IBM compiler.
Thanks, David. Here's a example.
.
(SUBSCRIPTRANGE):
T: PROCEDURE OPTIONS (MAIN);
DECLARE A(4,5) FLOAT, B(5,6) FLOAT, C(6,7) FLOAT;
B = 1; C = 2;
CALL ARITH (A, B, C);
ARITH:PROCEDURE (A, B, C);
DECLARE A(*,*) FLOAT, B(*,*) FLOAT, C(*,*) FLOAT;
B = 1; C = 2;
PUT SKIP LIST ('About to perform addition'); PUT SKIP;
A = B + C;
PUT SKIP LIST (A);
END ARITH;
END T;
Robin Vowels <robin....@gmail.com> wrote:.
On Tuesday, June 8, 2021 at 4:39:58 AM UTC+10, Thomas David Rivers wrote:
Robin Vowels wrote:.
In whole-array operations, IBM's Windows compiler does not checkHi Robin,
that arrays are compatible.
Even if SUBSCRIPTRANGE is enabled, there is no check.
Have there been any PL/I compilers that performed such a check?
If you post an example we can try it with the current IBM compiler.
Thanks, David. Here's a example.
.
(SUBSCRIPTRANGE):
T: PROCEDURE OPTIONS (MAIN);
DECLARE A(4,5) FLOAT, B(5,6) FLOAT, C(6,7) FLOAT;
B = 1; C = 2;
CALL ARITH (A, B, C);
ARITH:PROCEDURE (A, B, C);
DECLARE A(*,*) FLOAT, B(*,*) FLOAT, C(*,*) FLOAT;
B = 1; C = 2;
PUT SKIP LIST ('About to perform addition'); PUT SKIP;
A = B + C;
PUT SKIP LIST (A);
END ARITH;
END T;
What happens if you do A=B+C; in the main procedure, without a call to
ARITH?
On Tuesday, June 8, 2021 at 4:39:58 AM UTC+10, Thomas David Rivers wrote:
Robin Vowels wrote:.
In whole-array operations, IBM's Windows compiler does not checkHi Robin,
that arrays are compatible.
Even if SUBSCRIPTRANGE is enabled, there is no check.
Have there been any PL/I compilers that performed such a check?
If you post an example we can try it with the current IBM compiler.
Thanks, David. Here's a example.
.
(SUBSCRIPTRANGE):
T: PROCEDURE OPTIONS (MAIN);
DECLARE A(4,5) FLOAT, B(5,6) FLOAT, C(6,7) FLOAT;
B = 1; C = 2;
CALL ARITH (A, B, C);
ARITH:PROCEDURE (A, B, C);
DECLARE A(*,*) FLOAT, B(*,*) FLOAT, C(*,*) FLOAT;
B = 1; C = 2;
PUT SKIP LIST ('About to perform addition'); PUT SKIP;
A = B + C;
PUT SKIP LIST (A);
END ARITH;
END T;
Robin Vowels wrote:
On Tuesday, June 8, 2021 at 4:39:58 AM UTC+10, Thomas David Rivers wrote:I compiled this on z/OS 2.4 with this version of IBM PL/I:
Robin Vowels wrote:.
In whole-array operations, IBM's Windows compiler does not checkHi Robin,
that arrays are compatible. Even if SUBSCRIPTRANGE is enabled, there
is no check. Have there been any PL/I compilers that performed such
a check?
If you post an example we can try it with the current IBM compiler.
Thanks, David. Here's a example.
.
(SUBSCRIPTRANGE):
T: PROCEDURE OPTIONS (MAIN);
DECLARE A(4,5) FLOAT, B(5,6) FLOAT, C(6,7) FLOAT;
B = 1; C = 2;
CALL ARITH (A, B, C);
ARITH:PROCEDURE (A, B, C);
DECLARE A(*,*) FLOAT, B(*,*) FLOAT, C(*,*) FLOAT;
B = 1; C = 2;
PUT SKIP LIST ('About to perform addition'); PUT SKIP;
A = B + C;
PUT SKIP LIST (A);
END ARITH;
END T;
15655-PL5 IBM(R) Enterprise PL/I for z/OS V5.R3.M0 (Built:20190726)
and I got no errors, no warnings.
When I run it though, I get this:
About to perform addition
IBM0421S ONCODE=520 The SUBSCRIPTRANGE condition was raised.
From entry point ARITH at compile unit offset +000003FE at entry offset +000003FE at address 1F90B62E.
[1] + Done(137) ./incompat_array
50397979 Killed ./incompat_array
(under USS, which is why it's "Killed").
- Dave R. -
Robin Vowels wrote:
On Tuesday, June 8, 2021 at 4:39:58 AM UTC+10, Thomas David Rivers wrote:I compiled this on z/OS 2.4 with this version of IBM PL/I:
Robin Vowels wrote:.
In whole-array operations, IBM's Windows compiler does not checkHi Robin,
that arrays are compatible.
Even if SUBSCRIPTRANGE is enabled, there is no check.
Have there been any PL/I compilers that performed such a check?
If you post an example we can try it with the current IBM compiler.
Thanks, David. Here's a example.
.
(SUBSCRIPTRANGE):
T: PROCEDURE OPTIONS (MAIN);
DECLARE A(4,5) FLOAT, B(5,6) FLOAT, C(6,7) FLOAT;
B = 1; C = 2;
CALL ARITH (A, B, C);
ARITH:PROCEDURE (A, B, C);
DECLARE A(*,*) FLOAT, B(*,*) FLOAT, C(*,*) FLOAT;
B = 1; C = 2;
PUT SKIP LIST ('About to perform addition'); PUT SKIP;
A = B + C;
PUT SKIP LIST (A);
END ARITH;
END T;
15655-PL5 IBM(R) Enterprise PL/I for z/OS V5.R3.M0 (Built:20190726)
and I got no errors, no warnings.
When I run it though, I get this:
About to perform addition
IBM0421S ONCODE=520 The SUBSCRIPTRANGE condition was raised.
From entry point ARITH at compile unit offset +000003FE at
entry offset +000003FE at address 1F90B62E.
[1] + Done(137) ./incompat_array
50397979 Killed ./incompat_array
(under USS, which is why it's "Killed").
- Dave R. -
Robin Vowels wrote:
On Tuesday, June 8, 2021 at 4:39:58 AM UTC+10, Thomas David Rivers wrote:
Robin Vowels wrote:.
In whole-array operations, IBM's Windows compiler does not checkHi Robin,
that arrays are compatible.
Even if SUBSCRIPTRANGE is enabled, there is no check.
Have there been any PL/I compilers that performed such a check?
If you post an example we can try it with the current IBM compiler.
Thanks, David. Here's a example.
.
(SUBSCRIPTRANGE):
T: PROCEDURE OPTIONS (MAIN);
DECLARE A(4,5) FLOAT, B(5,6) FLOAT, C(6,7) FLOAT;
B = 1; C = 2;
CALL ARITH (A, B, C);
ARITH:PROCEDURE (A, B, C);
DECLARE A(*,*) FLOAT, B(*,*) FLOAT, C(*,*) FLOAT;
B = 1; C = 2;
PUT SKIP LIST ('About to perform addition'); PUT SKIP;
A = B + C;
PUT SKIP LIST (A);
END ARITH;
END T;
I compiled this on z/OS 2.4 with this version of IBM PL/I:
15655-PL5 IBM(R) Enterprise PL/I for z/OS V5.R3.M0 (Built:20190726)
and I got no errors, no warnings.
When I run it though, I get this:
About to perform addition.
IBM0421S ONCODE=520 The SUBSCRIPTRANGE condition was raised.
From entry point ARITH at compile unit offset +000003FE at
entry offset +000003FE at address 1F90B62E.
[1] + Done(137) ./incompat_array
50397979 Killed ./incompat_array
(under USS, which is why it's "Killed").
On Friday, June 11, 2021 at 9:52:50 PM UTC+10, Thomas David Rivers wrote:
Robin Vowels wrote:
On Tuesday, June 8, 2021 at 4:39:58 AM UTC+10, Thomas David Rivers wrote:
Robin Vowels wrote:.
In whole-array operations, IBM's Windows compiler does not check >>>that arrays are compatible.Hi Robin,
Even if SUBSCRIPTRANGE is enabled, there is no check.
Have there been any PL/I compilers that performed such a check?
If you post an example we can try it with the current IBM compiler.
Thanks, David. Here's a example.
.
(SUBSCRIPTRANGE):
T: PROCEDURE OPTIONS (MAIN);
DECLARE A(4,5) FLOAT, B(5,6) FLOAT, C(6,7) FLOAT;
B = 1; C = 2;
CALL ARITH (A, B, C);
ARITH:PROCEDURE (A, B, C);
DECLARE A(*,*) FLOAT, B(*,*) FLOAT, C(*,*) FLOAT;
B = 1; C = 2;
PUT SKIP LIST ('About to perform addition'); PUT SKIP;
A = B + C;
PUT SKIP LIST (A);
END ARITH;
END T;
I compiled this on z/OS 2.4 with this version of IBM PL/I:
15655-PL5 IBM(R) Enterprise PL/I for z/OS V5.R3.M0 (Built:20190726)
and I got no errors, no warnings.
When I run it though, I get this:
About to perform addition
IBM0421S ONCODE=520 The SUBSCRIPTRANGE condition was raised.
From entry point ARITH at compile unit offset +000003FE at
entry offset +000003FE at address 1F90B62E.
[1] + Done(137) ./incompat_array
50397979 Killed ./incompat_array
(under USS, which is why it's "Killed")..
Thanks, Dave. It's a considerable improvement over PL/I-F and PL/I for Windows.
Would it be possible to post the assembly listing?
(If it would be too long, please email me.) Many thanks.
El viernes, 11 de junio de 2021 a la(s) 19:21:21 UTC-3, Robin Vowels escribió:
On Friday, June 11, 2021 at 9:52:50 PM UTC+10, Thomas David Rivers wrote: >>> Robin Vowels wrote:
.
On Tuesday, June 8, 2021 at 4:39:58 AM UTC+10, Thomas David Rivers wrote: >>>>I compiled this on z/OS 2.4 with this version of IBM PL/I:
Robin Vowels wrote:.
In whole-array operations, IBM's Windows compiler does not checkHi Robin,
that arrays are compatible.
Even if SUBSCRIPTRANGE is enabled, there is no check.
Have there been any PL/I compilers that performed such a check?
If you post an example we can try it with the current IBM compiler.
Thanks, David. Here's a example.
.
(SUBSCRIPTRANGE):
T: PROCEDURE OPTIONS (MAIN);
DECLARE A(4,5) FLOAT, B(5,6) FLOAT, C(6,7) FLOAT;
B = 1; C = 2;
CALL ARITH (A, B, C);
ARITH:PROCEDURE (A, B, C);
DECLARE A(*,*) FLOAT, B(*,*) FLOAT, C(*,*) FLOAT;
B = 1; C = 2;
PUT SKIP LIST ('About to perform addition'); PUT SKIP;
A = B + C;
PUT SKIP LIST (A);
END ARITH;
END T;
15655-PL5 IBM(R) Enterprise PL/I for z/OS V5.R3.M0 (Built:20190726)
and I got no errors, no warnings.
When I run it though, I get this:
About to perform addition
IBM0421S ONCODE=520 The SUBSCRIPTRANGE condition was raised.
From entry point ARITH at compile unit offset +000003FE at
entry offset +000003FE at address 1F90B62E.
[1] + Done(137) ./incompat_array
50397979 Killed ./incompat_array
(under USS, which is why it's "Killed").
Thanks, Dave. It's a considerable improvement over PL/I-F and PL/I for Windows.
Would it be possible to post the assembly listing?
(If it would be too long, please email me.) Many thanks.
Actually it has no meaning in math or phisicaly to multipy 2 arrays of incompatible size, so why bother?
The only thing I think of is multiplying one array of measurements, by
some weight coeffcient, for digital filtering, even a 2 dimmension. But
since the size is declared previously it's trivial to check them before using it
carlos feldman <carlf...@gmail.com> wrote:.
Actually it has no meaning in math or phisicaly to multipy 2 arrays of incompatible size, so why bother?
The only thing I think of is multiplying one array of measurements, by some weight coeffcient, for digital filtering, even a 2 dimmension. But since the size is declared previously it's trivial to check them before using it
I’ve seen all kinds of bad code that doesn’t check things.
Heck, I’ve
WRITTEN lots of bad code. It’s always better for the compiler to check whatever it can and not depend on the user. PL/i (among other languages, I guess) is nice because it allows the programmer to turn off these checks to improve efficiency when desired, assuming that they make sure to do the checks themselves.
El viernes, 11 de junio de 2021 a la(s) 19:21:21 UTC-3, Robin Vowels escribió:
On Friday, June 11, 2021 at 9:52:50 PM UTC+10, Thomas David Rivers wrote:
Robin Vowels wrote:
On Tuesday, June 8, 2021 at 4:39:58 AM UTC+10, Thomas David Rivers wrote:
Robin Vowels wrote:.
In whole-array operations, IBM's Windows compiler does not check >>>that arrays are compatible.Hi Robin,
Even if SUBSCRIPTRANGE is enabled, there is no check.
Have there been any PL/I compilers that performed such a check?
If you post an example we can try it with the current IBM compiler.
Thanks, David. Here's a example.
.
(SUBSCRIPTRANGE):
T: PROCEDURE OPTIONS (MAIN);
DECLARE A(4,5) FLOAT, B(5,6) FLOAT, C(6,7) FLOAT;
B = 1; C = 2;
CALL ARITH (A, B, C);
ARITH:PROCEDURE (A, B, C);
DECLARE A(*,*) FLOAT, B(*,*) FLOAT, C(*,*) FLOAT;
B = 1; C = 2;
PUT SKIP LIST ('About to perform addition'); PUT SKIP;
A = B + C;
PUT SKIP LIST (A);
END ARITH;
END T;
I compiled this on z/OS 2.4 with this version of IBM PL/I:
15655-PL5 IBM(R) Enterprise PL/I for z/OS V5.R3.M0 (Built:20190726)
and I got no errors, no warnings.
When I run it though, I get this:
.About to perform addition
IBM0421S ONCODE=520 The SUBSCRIPTRANGE condition was raised.
From entry point ARITH at compile unit offset +000003FE at
entry offset +000003FE at address 1F90B62E.
[1] + Done(137) ./incompat_array
50397979 Killed ./incompat_array
(under USS, which is why it's "Killed")..
Thanks, Dave. It's a considerable improvement over PL/I-F and PL/I for Windows.
Would it be possible to post the assembly listing?
(If it would be too long, please email me.) Many thanks.
Actually it has no meaning in math or phisicaly to multipy 2 arrays of incompatible size, so why bother?.
The only thing I think of is multiplying one array of measurements, by some weight coeffcient,.
for digital filtering, even a 2 dimmension. But since the size is declared previously it's trivial
to check them before using it
On Tuesday, June 15, 2021 at 4:02:51 AM UTC+10, bearlyabus...@gmail.com wrote:that's part of debugging the code, thing is most programmers, forget they are working in real environments, and don't do real testing, where things happens. Like calculating a PID in metric units ans a process expecting imperial units ?
carlos feldman <carlf...@gmail.com> wrote:
Actually it has no meaning in math or phisicaly to multipy 2 arrays of incompatible size, so why bother?
The only thing I think of is multiplying one array of measurements, by some weight coeffcient, for digital filtering, even a 2 dimmension. But since the size is declared previously it's trivial to check them before using it
I’ve seen all kinds of bad code that doesn’t check things..
Remember Murphy's Law? "If anything can go wrong it will."
.
And then there's Roberts's Law: "Even if it can't go wrong it will."
.
Recall the Ariadne disaster? It failed because they did not include
a check for integer overflow.
.
Heck, I’ve
WRITTEN lots of bad code. It’s always better for the compiler to check whatever it can and not depend on the user. PL/i (among other languages, I guess) is nice because it allows the programmer to turn off these checks to
improve efficiency when desired, assuming that they make sure to do the checks themselves.
In whole-array operations, IBM's Windows compiler does not check
that arrays are compatible.
Even if SUBSCRIPTRANGE is enabled, there is no check.
Have there been any PL/I compilers that performed such a check?
On Friday, June 4, 2021 at 9:03:13 PM UTC-7, Robin Vowels wrote:
In whole-array operations, IBM's Windows compiler does not checkSorry I'm so late, I finally got around to checking.
that arrays are compatible.
Even if SUBSCRIPTRANGE is enabled, there is no check.
Have there been any PL/I compilers that performed such a check?
Iron Spring PL/I checks. For non-adjustable arrays it causes an error at compile time:
"(ERR418)Mismatched array dimension or bounds in assignment statement."
For adjustable arrays it raises the ERROR condition at execution time. I guess the consensus is that it should be SUBSCRIPTRANGE if enabled. It probably should raise ERROR if SUBSCRIPTRANGE is not enabled?
On Friday, June 4, 2021 at 9:03:13 PM UTC-7, Robin Vowels wrote:.
In whole-array operations, IBM's Windows compiler does not checkSorry I'm so late, I finally got around to checking.
that arrays are compatible.
Even if SUBSCRIPTRANGE is enabled, there is no check.
Have there been any PL/I compilers that performed such a check?
Iron Spring PL/I checks. For non-adjustable arrays it causes an error at compile time:
"(ERR418)Mismatched array dimension or bounds in assignment statement."
For adjustable arrays it raises the ERROR condition at execution time..
I guess the consensus is that it should be SUBSCRIPTRANGE if enabled..
It probably should raise ERROR if SUBSCRIPTRANGE is not enabled?.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 251 |
Nodes: | 16 (2 / 14) |
Uptime: | 25:15:55 |
Calls: | 5,544 |
Calls today: | 3 |
Files: | 11,676 |
Messages: | 5,109,451 |