• Unterminated character array in order relation

    From August Karlstrom@21:1/5 to All on Thu Mar 1 14:23:10 2018
    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From August Karlstrom@21:1/5 to August Karlstrom on Sun Mar 4 12:44:23 2018
    On 2018-03-01 14:23, August Karlstrom wrote:
    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)