[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Gm2] Problem with printf
From: |
Dmitry Shatrov |
Subject: |
Re: [Gm2] Problem with printf |
Date: |
Mon, 19 Nov 2007 17:58:01 +0300 |
On Nov 19, 2007 5:25 PM, Dmitry Shatrov <address@hidden> wrote:
> Hello,
>
> I'm experiencing weird behavior when passing parameters to printf().
> If I read gm2 docs ( http://www.nongnu.org/gm2/gm2.html ) correctly, my
> code should work, because it is just like in an example from chapter
> 1.9.
>
> Here's the test case. The following program should print "ABC 1 2 3",
> but what I get is "ABC 1 0 2". I'm using fresh gm2 from CVS.
My fault, sorry. The following works fine:
MODULE test;
FROM SYSTEM IMPORT ADR;
FROM libc IMPORT printf;
PROCEDURE Test (str : ARRAY OF CHAR);
VAR
r : INTEGER;
BEGIN
r := printf ("%s %u %u %u\n", ADR (str),
CARDINAL (1), CARDINAL (2), CARDINAL (3));
END Test;
BEGIN
Test ("ABC");
END test.
Wbr,
Dmitry