gm2
[Top][All Lists]
Advanced

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

[Gm2] Problem with printf


From: Dmitry Shatrov
Subject: [Gm2] Problem with printf
Date: Mon, 19 Nov 2007 17:25:14 +0300

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.


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), 1, 2, 3);
END Test;

VAR
    r : INTEGER;
BEGIN
    Test ("ABC");

END test.






reply via email to

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