Discussion:
Unterminated character array in order relation
(too old to reply)
August Karlstrom
2018-03-01 13:23:10 UTC
Permalink
Are the order relations in Oberon (latest rev.) supposed to work with
unterminated character arrays or is it considered undefined behavior?

Example:

MODULE test;

IMPORT Out;

VAR s: ARRAY 1 OF CHAR;

BEGIN
s[0] := "A";
IF s = "A" THEN
Out.String("equal")
ELSE
Out.String("not equal")
END;
Out.Ln
END test.


-- August
August Karlstrom
2018-03-04 11:44:23 UTC
Permalink
Post by August Karlstrom
Are the order relations in Oberon (latest rev.) supposed to work with
unterminated character arrays or is it considered undefined behavior?
As we have not received any answers yet (no one knows), I assume that
the behavior is undefined. This means that an Oberon compiler can choose
to trap relational operations involving unterminated character
sequences, although the PO 2013 implementation has chosen not to do so.


-- August

Loading...