[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Gm2] Error in GM2 with open array of bytes
From: |
Gaius Mulley |
Subject: |
Re: [Gm2] Error in GM2 with open array of bytes |
Date: |
Mon, 26 Jan 2015 11:59:59 +0000 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux) |
Michael Riedl <address@hidden> writes:
> Hallo,
>
> being new on this please excuse if this is not the right place to post
> bug reports to.
>
> I compiled GM2 gm2-1.1.0 and also installed the pre-compiled package on
> an Ubuntu LTS 12.04 (but get identical results on 14.04).
>
> With the following (simplified) definition module
>
> DEFINITION MODULE FA;
>
> FROM SYSTEM IMPORT BYTE;
>
> PROCEDURE Out1(Format : ARRAY OF CHAR;
> Par1 : ARRAY OF BYTE);
>
> END FA.
>
> and a quite simple test program
>
> MODULE FAtest;
>
> FROM FA IMPORT Out1;
> BEGIN
> Out1("//,S,//","Test");
> END FAtest.
>
Hi Michael,
now fixed in the git repository. I'd just to double check that the
regression test code also committed is correct:
MODULE bytearray ;
FROM SYSTEM IMPORT BYTE ;
FROM libc IMPORT printf, exit ;
PROCEDURE bytes (b: ARRAY OF BYTE; s: CARDINAL) ;
BEGIN
IF HIGH(b)#s-1
THEN
printf ("passing ARRAY OF BYTE failed, expected %d and received %d
bytes\n", s, HIGH(b)) ;
exit (1)
END
END bytes ;
VAR
i: INTEGER ;
c: CARDINAL ;
ch: CHAR ;
BEGIN
bytes (i, SIZE(i)) ;
bytes (c, SIZE(c)) ;
bytes (ch, SIZE(ch)) ;
bytes ("hello world", 12)
END bytearray.
I guess I'm seeking clarification about the bytes passed "hello world"
(ie no trailing \0 byte)
regards,
Gaius