Boost logo

Boost :

From: Rozental, Gennadiy (gennadiy.rozental_at_[hidden])
Date: 2002-12-10 16:06:21


> >> > \runtime-link-dynamic\execution_monitor.obj
> >> >> ### mwcc Compiler:
> >> >> # File: ..\libs\test\src\execution_monitor.cpp
> >> >> # -----------------------------------------------
> >> >> # 157: case _CRT_ASSERT:
> >> >> # Error: ^^^^^^^^^^^
> >> >> # undefined identifier '_CRT_ASSERT'
> >> >> ### mwcc Compiler:
> >> >> # 161: case _CRT_ERROR:
> >> >> # Error: ^^^^^^^^^^
> >> >> # undefined identifier '_CRT_ERROR'
> >> >
> >> > This one appears to be caused by the fact that metrowerks
> >> tools does not
> >> > define the symbol _DEBUG in debug mode
> >>
> >> Why don't you fix that one, too?
> >> _DEBUG is an MSVC-specific symbol.
> >
> > MSVC toolset defines it.
>
> I see no evidence to support that claim.
>
> The msvc compiler flags which turn on debug symbols, etc., also cause
> _DEBUG to be defined. The toolset never touches "_DEBUG".

Whatever. The net result is that C runtime debug hooks are gets defined in
debug mode.
 
> > While metrowerks don't. Do you want me to fix the latter?
>
> I don't think I want you to "fix" it. As a user, you're not allowed
> to #define _DEBUG, since that symbol is reserved to the
> implementation.
>
> > Where would be the best place to put debug specific definitions?
>
> #ifndef NDEBUG
> ...
> #endif

I am already doing this in mycode. But it only hides the problem. Metrowerks
has the header <crtdbg.h> similar to MSVC one. If you will take a look into
this header you see that C runtime debug hooks (_CRT_ERROR is part if this
API) are gets defined if _DEBUG is defined. I think that it is natural to
assume that debug hooks should be defined in debug mode. So I still believe
that some compiler option is missing and that needs to be fixed.

Gennadiy.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk