Unexplainable compilation error using CCS 3.2 on UnixWare 7.1.1 - SCO

This is a discussion on Unexplainable compilation error using CCS 3.2 on UnixWare 7.1.1 - SCO ; We have an unexplainable compilation error that affects several source files. This product has been ported to other Unix platforms without any problem. This is our development environment on UnixWare 7.1.1. Our system has: UnixWare vbroker1 5 7.1.1 i386 x86at ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: Unexplainable compilation error using CCS 3.2 on UnixWare 7.1.1

  1. Unexplainable compilation error using CCS 3.2 on UnixWare 7.1.1

    We have an unexplainable compilation error that affects several source
    files. This product has been ported to other Unix platforms without
    any problem. This is our development environment on UnixWare 7.1.1.

    Our system has:
    UnixWare vbroker1 5 7.1.1 i386 x86at SCO UNIX_SVR5

    Optimizing C Compilation System (CCS) 3.2
    UX:CC: INFO: C++ Compilation System 3.1 09/28/99
    (santamariasbl5.1.rs1ubl7)

    %ld -V
    UX:ld: INFO: Optimizing C Compilation System (CCS) 3.2 08/02/01
    (uw711_vcutbl5.1)

    gmake -v
    GNU Make version 3.76.1, by Richard Stallman and Roland McGrath.


    The problem in general is that the compiler confuses the function name
    with leading "_" char like "_shutdown()" to "shutdown()".
    Here is an example :-

    Header file (child.h):

    class child : public generatedCPP
    {
    protected:
    void _shutdown(); // internal use

    public:
    void shutdown();
    void shutdown(const char* msg, int abc);
    }

    Implemenation file (child.C):

    void child::_shutdown() {
    // some code;
    }
    void child::shutdown() {
    // some code
    _shutdown();
    }
    void child::shutdown(char* msg, int abc) {
    // some code
    _shutdown();
    }

    The compilation error is:
    :child.h, line xxx: error: function "child::_shutdown()" has already
    been declared :child.C, line xxx: error: function "child::_shutdown()"
    has already been defined

    If I rename the protected function _shutdown() to _my_shutdown(),
    child.C will compile but the caller class will have this compilation
    error:
    "caller.C", line 2193: error: class "child" has no member "_shutdown"

    class caller {
    //other code;
    void caller::test() {
    // other code
    child::shutdown(); <= compilation fail here.
    }
    }

    It seems like the compiler sees child::shutdown() function call in
    caller.C and expects to find _shutdown() in child.h. The only way to
    work around is to change the public function name shutdown() to
    my_shutdown() so that the protected _shutdown() has a different name
    with public shutdown() function like this:

    clase childublic generatedCPP
    {
    protected:
    void _shutdown();
    public:
    void my_shutdown();
    void shutdown(char* msg, int abc);
    }

    After numerious trials to rename and change position of function
    declaration in the header file, we belive that the compiler is
    confused with the function name _ABC with generated symbol _ABC since
    we have other files with similar problem for _send() and send().

    Also the compiler will complain with same error even the source code
    only has ONE shutdown() declaration in header and implementation in .C
    file in the same directory. The compiler will still look for
    _shutdown and return an error. "abc.C", line 552: error: class
    "myFile" has no member "_shutdown"

    In addition, if we rename the shutdown() then it will complain the
    virtual function of shutdown in parent class is not overloaded. pure
    virtual function "ProtocolEngine::EngineManager::shutdown" has no
    overrider
    _protocol_manager = new VISProtocolManager;

    The unfortunate things is that the compilation error only happens to
    our source code. I have a very simple header file (test.h) and source
    file (test.C) like the example above. The sample files compile ok?!
    The sample test files are located in the same directory and defined in
    the Makefile using same gmake and CC compiler (with same switch
    settings).

    Could this possibly a bug in the compiler? Can someone point me to
    the right direction?

    Many thanks!

  2. Re: Unexplainable compilation error using CCS 3.2 on UnixWare 7.1.1

    On 3 Dec 2003 14:14:51 -0800, clement tang wrote:
    > We have an unexplainable compilation error that affects several source


    This isn't so unexplainable. When you asked this same question
    yesterday, you got two perfectly lovely (and incredibly similar)
    explanations that optimized down to "quit using reserved identifiers"


+ Reply to Thread