gm2
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Is strings in gm2 null terminated?


From: Benjamin Kowarsch
Subject: Re: Is strings in gm2 null terminated?
Date: Wed, 25 Mar 2020 03:55:52 +0900

Up to PIM3 all character arrays had to be null terminated EXCEPT when the character string completely filled the array up to its storage capacity. As of PIM4, every character array has to be null terminated without any exceptions. It is not visible in the syntax but it is definitely mandatory semantics as per language report and I seem to remember that ISO M2 adopted the PIM4 semantics.

On Wed, 25 Mar 2020 at 03:39, Fischlin Andreas <address@hidden> wrote:
Dear Hung Hung,

It is a convention of M2 since its invention to null (0C) terminate strings. This is not enshrined in the syntax, but clearly “supported” by it (e.g. by open arrays and their indexing etc.). The semantic interpretation of strings to be null terminated I would call more or less “mandatory” and therefore every compiler, not only gm2, should respect this. I would personally immediately ignore any M2 compiler that would not do so.

Hope this answers your question.

Regards, Andreas 

ETH Zurich, Prof. em. Dr. Andreas Fischlin, IPCC Vice-Chair WGII, Systems Ecology, CHN E 24, Universitaetstrasse 16, CH-8092 Zurich, SWITZERLAND
Tel: +41 44 633-6090   Mobile: +41 79 595-4050   Mail: address@hidden

On 21 Mar 2020, at 15:34, Hưng Hưng <address@hidden> wrote:


I read on modula2.org it said for compatitbity strings in modula-2 also null terminated. But it's particular to their adw compiler. What about gm2?

reply via email to

[Prev in Thread] Current Thread [Next in Thread]