Board index » cppbuilder » Issues with NDEBUG and std namespace

Issues with NDEBUG and std namespace


2004-05-11 04:29:21 PM
cppbuilder114
My colleague's machine has started having problems compiling for release
(clicking on the button on project options) with NDEBUG defined. It moves a
whole slew of functions (strXXX basically) out of the default std namespace
with the result that they all need to be prefixed by 'std::'.
We share the same project source (well, we keep them up to date every week)
and I have not seen this problem with the same projects.
Obviously this is a PITA and we can't work out why it's happening. It
seemed to occur after my colleague had built the libraries for the boost
regular expression library (know affectionately as Reginald Explosion) but
we can't see anything in the make file that would cause this issue.
Can anyone suggest what might be causing this?
The problem also occurs when compiling from the command line using a make
file exported by the IDE. We have performed a diff of the Borland headers
and these show no differences.
--
Andrue Cope
[Bicester UK]
 
 

Re:Issues with NDEBUG and std namespace

Andrue Cope < XXXX@XXXXX.COM >wrote in
Quote
Can anyone suggest what might be causing this?

The problem also occurs when compiling from the command line using a
make file exported by the IDE. We have performed a diff of the Borland
headers and these show no differences.
We had something similar some time ago, now lets see if I can remember the
details.... I can't remember the methods we were using, but it came down to
in debug mode they were normal methods, but in release mode they were
actually #defines (or vice verse). Making one need the namespace and one
not wanting it at all. We got around it by putting "using namespace std;"
just above the call so if it wanted it it would use it, otherwise it would
just work.
Simon
 

Re:Issues with NDEBUG and std namespace

On 11 May 2004 16:08:43 -0700, Simon Macneall wrote:
Quote
Making one need the namespace and one
not wanting it at all.
Interesting - now we just have to find out why my colleague's machine has
this problem. It gives us something else to consider so thanks.
--
Andrue Cope
[Bicester UK]
 

{smallsort}

Re:Issues with NDEBUG and std namespace

Andrue Cope wrote:
Quote
My colleague's machine has started having problems compiling for release
(clicking on the button on project options) with NDEBUG defined. It moves a
whole slew of functions (strXXX basically) out of the default std namespace
with the result that they all need to be prefixed by 'std::'.
These are probably the intrinsics. strcmp has this problem I think. It
is a compiler bug and I reported it quite some time ago. Not sure if or
when it will be fixed.
For example, this code compiles fine in debug mode. In release mode, in
generates a compiler error.
#include <cstring>
int main()
{
char *s1 = "hello";
char *s2 = "world";
return !std::strcmp(s1, s2);
}
[C++ Error] Unit1.cpp(7): E2316 '__strcmp__' is not a member of 'std'
This bug prevents people from compiling boost::python with bcb in
release mode, in addition to some of the other boost libraries.
H^2
 

Re:Issues with NDEBUG and std namespace

On Sat, 15 May 2004 11:04:04 -0500, Harold Howe [TeamB] wrote:
Quote
These are probably the intrinsics. strcmp has this problem I think. It
is a compiler bug and I reported it quite some time ago. Not sure if or
when it will be fixed.
{*word*193} - we have resolved it slightly by aborting the compile if NDEBUG is
set. Unfortunately we can't work out why only his machine has the problem.
He should be installing stuff on a new machine soon though so hopefully
he'll leave the problem behind.
--
Andrue Cope
[Bicester UK]