Codewarrior Command Line Compiler

Try compiling this code with the Codewarrior Palm 9 command-line tools (which were a big selling point of the upgrade):

class CTest
{
public:
    CTest( CNonExistentClass* obj )
    {
    };
    virtual ~CTest ( )
    {
    };
};

This will cause mwc68k to crash with an access fault.

Update: On codewarrior.palm, Ben Combee (former Palm development lead at Metrowerks) confirmed the bug.

It seems the 9.3 command line compilers are totally borked. Metrowerks has known about it since at least February 2004. The 9.2 ones work. Except, of course, that the code generated by 9.0, 9.1 and 9.2 is completely unusable. In other words, Metrowerks never delivered one of their key features of Codewarrior Palm v9.

3 Responses to “Codewarrior Command Line Compiler”

  1. Ben Combee Says:

    Stephen, I’m curious why you call the 9.2 68K code completely unusable. IIRC, there were two 68K code gen bug fixes in 9.3:

    A major bug affecting inline assembly in the 68K C/C++ compilers was
    fixed. In V9.0 through V9.2, some inline assembly opcodes would be
    output incorrectly.

    A code generation bug would cause comparisons to fail if they
    immediately followed the load from memory of a data item of a
    different size, such as reading a char into an int, then comparing
    that int to 0.

    I’m really sorry that I messed up the error routines — that shouldn’t have happened, but we didn’t have tests of building bad code with the command line tools, just code gen tests for correctness.

    I have talked to MWRon about this bug, BTW, but I don’t have access to the source or tools needed to fix this myself. The problem was a bad define in one of the compiler’s headers that made all the error message numbers off-by-lots, and it only affected the command line tools because those had error messages bound into the executable using a different mechanism than the plugin compiler.

  2. Steven Fisher Says:

    You might be fair when you say it isn’t completely unusable. However, in my view, when I can’t trust a compiler to at least generate a warning when code might be invalid… well, trust is the first thing I require out of a compiler. I’d actually much rather have the crash.

  3. Objects At Rest » Blog Archive » CodeWarrior’s command line build Says:

    [...] So I finally worked up the courage to try to add scripted building to my project again. I originally wanted to use the command line tools, but that didn’t work. So I decided this time to try the IDE. [...]

Leave a Reply