public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug modula2/115276] New: libgm2 wraptime.InitTM returns NIL
@ 2024-05-29 13:33 gaius at gcc dot gnu.org
  2024-05-29 13:38 ` [Bug modula2/115276] " gaius at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: gaius at gcc dot gnu.org @ 2024-05-29 13:33 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115276

            Bug ID: 115276
           Summary: libgm2 wraptime.InitTM returns NIL
           Product: gcc
           Version: 15.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: modula2
          Assignee: gaius at gcc dot gnu.org
          Reporter: gaius at gcc dot gnu.org
  Target Milestone: ---

As reported on the gm2 mailing list the following code fails:


MODULE hello5;

FROM StrIO IMPORT WriteString, WriteLn;
FROM NumberIO IMPORT WriteInt;
FROM wraptime IMPORT timeval, InitTimeval, KillTimeval, gettimeofday, timezone,
InitTimezone, KillTimezone, localtime_r, tm, InitTM, KillTM, GetYear, GetMonth,
GetDay;

VAR tv: timeval;
    tz: timezone;
    i: INTEGER;
    m: tm;

BEGIN

    tv := InitTimeval();
    tz := InitTimezone();
    m  := InitTM();
    i  := gettimeofday(tv, tz);
    m  := localtime_r(tv, m);

    WriteString("i = ");
    WriteInt(i, 0);
    WriteLn;
    WriteString("Year = ");
    WriteInt(GetYear(m), 0);
    WriteLn;
    WriteString("Month = ");
    WriteInt(GetMonth(m), 0);
    WriteLn;
    WriteString("Day = ");
    WriteInt(GetDay(m), 0);
    WriteLn;

    m  := KillTM(m);
    tv := KillTimeval(tv);
    tz := KillTimezone(tz);
END hello5.

reproduced by building gm2 trunk using:

Configured with: ../configure --prefix=/home/gaius/opt --disable-bootstrap
--disable-multilib --enable-languages=m2

$ gm2 -g hello5.mod
$ ./a.out

(On a debian x86_64 release 12 system)

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-05-29 18:37 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-05-29 13:33 [Bug modula2/115276] New: libgm2 wraptime.InitTM returns NIL gaius at gcc dot gnu.org
2024-05-29 13:38 ` [Bug modula2/115276] " gaius at gcc dot gnu.org
2024-05-29 15:27 ` gaius at gcc dot gnu.org
2024-05-29 16:27 ` cvs-commit at gcc dot gnu.org
2024-05-29 18:37 ` gaius at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).