[Oberon] NEW with anonymous records

Chris Burrows chris at cfbsoftware.com
Tue Feb 20 08:43:55 CET 2018


> -----Original Message-----
> From: Oberon [mailto:oberon-bounces at lists.inf.ethz.ch] On Behalf Of
> Peter Matthias
> Sent: Tuesday, 20 February 2018 6:29 AM
> To: ETH Oberon and related systems
> Subject: [Oberon] NEW with anonymous records
> 
> When allocating memory of a pointer to an anonymous record in PO,
> system crashes after time. How to fix or disable this behaviour?
> 
> VAR a: POINTER TO RECORD c, d: INTEGER END; ...
> NEW(a)
> 

I believe this problem was addressed in the 23.9.2017 update of Project
Oberon with a language restriction implemented in ORP.Mod. If you try to
compile the code above you will now get the error message:

  "Error: must point to named record"  

Follow the practice used throughout Project Oberon i.e. declare your record
as a type and then declare your pointer as a pointer to that type. For
example:

TYPE
  ItemDesc = RECORD c, d: INTEGER END;

VAR
  a: POINTER TO ItemDesc;

Regards,
Chris Burrows
CFB Software
http://www.astrobe.com/RISC5







More information about the Oberon mailing list