gm2
[Top][All Lists]
Advanced

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

[Gm2] Re: Modula 2 bug? (fixed)


From: Gaius Mulley
Subject: [Gm2] Re: Modula 2 bug? (fixed)
Date: Fri, 30 Apr 2010 15:14:29 +0100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux)

Steve Giess <address@hidden> writes:

> Dear Gaius,
>
> Using today's CVS I found that the attached programme (an exemplar from a
> programme that I am writing today) failed to compile.
>
> I assumed that the use of expressions that evaluated to a constant was allowed
> in ISO Modula-2. Am I incorrect?
>
> Regards,
>
> Steve

Hi Steve,

just fixed the bug which is now in the latest cvs.
gm2 now allows all gcc builtins in constant declarations.
Thanks for the report,

       * gm2/gm2-compiler/M2GenGCC.mod:  doParam (New procedure).
         FoldBuiltin (New procedure).  Changes allow gcc builtins
         to be called from constant expressions.
       * gm2/gm2-compiler/M2Quads.mod:  modified
         BuildConstFunctionCall to allow gcc builtins to be called.
       * gm2/gm2-compiler/gccgm2.def:  export SetLastFunction.

For example this allows the following code to compile:


MODULE const1 ;

FROM RealMath IMPORT sqrt ;

CONST
   foo = CMPLX(0.0,1.0/sqrt(2.0)) ;

VAR
   z :COMPLEX;
BEGIN
   z := foo
END const1.


gm2 has been modified so that it detects non gcc builtin functions and
pervasive functions and it will generate an error message if another
function is used in a constant declaration.

regards,
Gaius





reply via email to

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