www.digitalmars.com Home | Search | C & C++ | D | DMDScript | News Groups | index | prev | next
Archives

D Programming
D
D.gnu
digitalmars.D
digitalmars.D.bugs
digitalmars.D.dtl
digitalmars.D.dwt
digitalmars.D.announce
digitalmars.D.learn
digitalmars.D.debugger

C/C++ Programming
c++
c++.announce
c++.atl
c++.beta
c++.chat
c++.command-line
c++.dos
c++.dos.16-bits
c++.dos.32-bits
c++.idde
c++.mfc
c++.rtl
c++.stl
c++.stl.hp
c++.stl.port
c++.stl.sgi
c++.stlsoft
c++.windows
c++.windows.16-bits
c++.windows.32-bits
c++.wxwindows

digitalmars.empire
digitalmars.DMDScript

c++ - Error Code Help Requested

↑ ↓ ← Gregg <no spam.com> writes:
When compiling a code with DMC I get the following message:

Internal error: cod2 3692
--- errorlevel 1

I have looked on the Digital Mars website for clues as to the meaning of 
the code, but cannot find any.  The code successfully compiles with GCC 
GNU 4.1.1 and  MSVC++ 7.1.

Any suggestions as to where to look within the code would be helpful and 
appreciated.
Nov 01 2006
→ Walter Bright <newshound digitalmars.com> writes:
Gregg wrote:
 Any suggestions as to where to look within the code would be helpful and 
 appreciated.

http://www.digitalmars.com/bugs.html
Nov 01 2006
"Matthew" <matthew hat.stlsoft.dot.org> writes:
I have a certain familiarity with DMC++ (and other compiler) ICE bugs. Why
not post the code (or an effective snapshot of it) and I'll see if I
recognise anything.

Matthew

"Gregg" <no spam.com> wrote in message
news:eib632$1pd9$1 digitaldaemon.com...
 When compiling a code with DMC I get the following message:

 Internal error: cod2 3692
 --- errorlevel 1

 I have looked on the Digital Mars website for clues as to the meaning of
 the code, but cannot find any.  The code successfully compiles with GCC
 GNU 4.1.1 and  MSVC++ 7.1.

 Any suggestions as to where to look within the code would be helpful and
 appreciated.

Nov 01 2006
↑ ↓ Gregg <no spam.com> writes:
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Attached is about as simple an example of the problem as I can get.  As 
noted in my original post, it compiles (and links and runs) successfully 
with GCC GNU 4.1.1 and MSVC++ 7.1 and compiles successfully with Comeau 
4.3.8 (using their online test tool).

When I run the code in its attached form I get the following compile 
time error message:

Internal error: cod1 1293
--- errorlevel 1

When class A is defined in separate source and header files, compiling 
the source file yields the error message I mentioned in my earlier post.

The compile command I am using is:

dmc -Ic:\dm\stlport\stlport TestInline.cpp

The problem seems to involve combinations of the use of inline, static, 
and std::pair.  I've seen this before and have work arounds, but that 
becomes cumbersome when dealing with existing library code (e.g., 
special versions of library code for use w/ DMC).

Thanks again for any help.


Matthew wrote:
 I have a certain familiarity with DMC++ (and other compiler) ICE bugs. Why
 not post the code (or an effective snapshot of it) and I'll see if I
 recognise anything.
 
 Matthew
 
 "Gregg" <no spam.com> wrote in message
 news:eib632$1pd9$1 digitaldaemon.com...
 When compiling a code with DMC I get the following message:

 Internal error: cod2 3692
 --- errorlevel 1


Nov 02 2006
→ Walter Bright <newshound digitalmars.com> writes:
Gregg wrote:
 Attached is about as simple an example of the problem as I can get.

Thanks for doing this. It helps.
Nov 02 2006
"Matthew" <matthew hat.stlsoft.dot.org> writes:
Hi

I think you've done an excellent job of paring it down for Walter's
purposes - i.e. to be able to replicate, identify and fix the bug - but
probably a little too much for the kind of workarounds I'm familiar with.
;-)

If Walter can get this fixed soonish, that's probably your best bet. If not,
or if you can't wait for a new beta, I'd be happy to take a look at
something a little more substantial. From what you've presented, several
things come to mind, but they may not be appropriate in the real code. FWIW:

 - use a custom template pair instead of std::pair
 - use a non-template pair instead of std::pair
 - use a static reference and a static ptr+auto_ptr, e.g.

    typedef std::pair<int, int>    pair_t;
    static std::auto_ptr<pair_t>   b_(new pair_t(1, 1));
    static pair_t                            &b = *b_.get();

    (Note: this has thread-safety implications.)

 - move the static into another function / scope, e.g. into a local
namespace

That's all I can think of right now. HTH




"Gregg" <no spam.com> wrote in message
news:eidasr$p4v$1 digitaldaemon.com...
 Attached is about as simple an example of the problem as I can get.  As
 noted in my original post, it compiles (and links and runs) successfully
 with GCC GNU 4.1.1 and MSVC++ 7.1 and compiles successfully with Comeau
 4.3.8 (using their online test tool).

 When I run the code in its attached form I get the following compile
 time error message:

 Internal error: cod1 1293
 --- errorlevel 1

 When class A is defined in separate source and header files, compiling
 the source file yields the error message I mentioned in my earlier post.

 The compile command I am using is:

 dmc -Ic:\dm\stlport\stlport TestInline.cpp

 The problem seems to involve combinations of the use of inline, static,
 and std::pair.  I've seen this before and have work arounds, but that
 becomes cumbersome when dealing with existing library code (e.g.,
 special versions of library code for use w/ DMC).

 Thanks again for any help.


 Matthew wrote:
 I have a certain familiarity with DMC++ (and other compiler) ICE bugs.


 not post the code (or an effective snapshot of it) and I'll see if I
 recognise anything.

 Matthew

 "Gregg" <no spam.com> wrote in message
 news:eib632$1pd9$1 digitaldaemon.com...
 When compiling a code with DMC I get the following message:

 Internal error: cod2 3692
 --- errorlevel 1



---------------------------------------------------------------------------- ----
 #include <utility>

 class A {
   int getSomething();
 };

 inline
 int A::getSomething() {
   static std::pair<int, int>  b(1, 1);
   return 0;
 }

 int main() {
   return 0;
 }

Nov 04 2006
↑ ↓ Gregg <no spam.com> writes:
Matthew wrote:
  - use a custom template pair instead of std::pair
  - use a non-template pair instead of std::pair
  - use a static reference and a static ptr+auto_ptr, e.g.
 
     typedef std::pair<int, int>    pair_t;
     static std::auto_ptr<pair_t>   b_(new pair_t(1, 1));
     static pair_t                            &b = *b_.get();
 
     (Note: this has thread-safety implications.)
 
  - move the static into another function / scope, e.g. into a local
 namespace

All good suggestions to be sure. I've opted for the simplest change to the existing code: comment out the inline statement. I'm hoping this change stands the least chance of breaking something else.
Nov 05 2006
↑ ↓ → "Matthew" <matthew hat.stlsoft.dot.org> writes:
 All good suggestions to be sure.  I've opted for the simplest change to
 the existing code: comment out the inline statement.  I'm hoping this
 change stands the least chance of breaking something else.

:-) Good luck!
Nov 05 2006