🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.atari.st
Article #30917

Laser C bug reports/notes

#30917
From: Dave Clemans
Date: Mon, 29 Feb 1988 18:11
87 lines
3822 bytes
This is what I've seen so far trying to port over a large working
package from Megamax C version 1 to Megamax Laser C:

1. Generation of bad code

    in a routine like

            foo()
            {
                .
                .
                .
                if (...)
                {
                    if (...)
                        return;
                }
            #ifdef bar
                bar is not defined, so this block goes away
            #endif
            }

    at the end of the routine there was a garbled branch instruction,
    that the outer "if" tried to jump into the middle of.  The instruction
    to restore register variables was missing.  This was relatively
    easy to find with the traceback facilities of the shell.

    presumably what happened was that the generated code originally was
                bne ret
        ret:    restore regs
                unlink
                rts
    and then the optimizer came along and didn't collapse the branch correctly

2. libraries/linker

    ar seems to create libraries without a "ranlib" index by default.  However
    if the linker sees a library without a "ranlib" index it seems to go into
    an infinite loop.

    once a library has a "ranlib" index ar intermittently has problems updating
    members in the library; it sometimes says that the library has a bad format.
    This doesn't happen consistently so I don't know what causes it.

3.  cc

    cc supports a -l switch to reference libraries, and a LIBPATH environment
    variable to help it find libraries.  The ability to use this facility would
    be extremely useful, as what I'm trying to do is large enough that I have
    trouble fitting it into the 127 max command line lengths of make.

    However cc seems to process all -l switches first, and scans those libraries
    first before any other files are looked at (presumably because of how cc
    builds the command line for the ld).  Since there are no undefined references
    yet, it never loads anything from those libraries, thus the -l switch to cc
    is TOTALLY and COMPLETELY USELESS!  "-l" switches should signal that the
    library is searched in the order that the switches appear in the argument list;
    if a "-l" switch appears after a filename, the library must be searched AFTER
    the object for that filename is loaded.

    If you reference libraries via a real pathname, everything works fine.

4.  utilities

    Presumably "cp" is a command to copy a file; experimenting with it definitely
    makes it look like it wants to copy a file.  However it gives the file "copy"
    a read-only attribute.  With that attribute you can't modify, edit, delete, etc.
    any "copied" file within the shell environment.

*** I may find more bugs; the package is still having problems

5.  miscellaneous notes

    (These aren't bug reports...)

    If there's going to be any further problem in getting the real documentation, could
    someone at Megamax on what the libx library is?  From the header file it looks interesting.

    It looks like the compiler now has only 8 significant characters, vs. 10 characters in V1.

    The "overlay" keyword is gone

    By default you get a 8KB stack; to get more declare and initialize a long integer _stksize
    with the desired stack size.

Dave Clemans
dclemans@pdx.mentor.com
Technical Details
Message-ID: <1988Feb29.101120.12013@mntgfx.mentor.com>
Path: arc1-ca.pugleaf.net!utzoo!mnetor!uunet!tektronix!sequent!mntgfx!dclemans

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!mnetor!uunet!tektronix!sequent!mntgfx!dclemans
From: dclemans@mntgfx.mentor.com (Dave Clemans)
Newsgroups: comp.sys.atari.st
Subject: Laser C bug reports/notes
Message-ID: <1988Feb29.101120.12013@mntgfx.mentor.com>
Date: 29 Feb 88 18:11:14 GMT
Organization: Mentor Graphics Corporation, Beaverton Oregon
Lines: 87
Keywords: Megamax Laser C