Home Bug Reports

_STLP_DEBUG declared in IceUtils/Config.h

julienjulien Member Julien GueganOrganization: LombardOdier & cieProject: bank software for portfolio management
Hi all,

I am having a little trouble when trying to use STLPort in debug with ICE...

The following code can be found in IceUtils/Config.h

//
// For STLport. If we compile in debug mode, we want to use the debug
// STLport library. This is done by setting _STLP_DEBUG before any
// STLport header files are included.
//
// TODO: figure out why IceUtil does not compile with _SLTP_DEBUG using
// the Intel compiler.
//
#if !defined(NDEBUG) && !defined(_STLP_DEBUG) && !defined(__INTEL_COMPILER) && !defined(__BCPLUSPLUS__)
# define _STLP_DEBUG
#endif

We use STLPort in some of our libraries outside of ICE and this is causing crashes when we try to use both ICE and our libraries. We can not use _STLP_DEBUG because it changes the size of objects between release and debug builds...

I don't think it is ICE's responsibility to define how to use STLPort. This should be done in the STLPort headers (user_config.h) or at least check if ICE is really built with STLPort...

The fix for me is rather easy, I just comment out the #define but I'd like not to have to do it every time we update ICE...

Would you consider changing the IceUtils/Config.h header?

Thanks

Comments

  • bernardbernard Jupiter, FLAdministrators, ZeroC Staff Bernard NormierOrganization: ZeroC, Inc.Project: Ice ZeroC Staff
    Hi Julien,

    Thank you for this bug report. Ice should definitely not define unconditionally (or almost unconditionally) _STLP_DEBUG.

    Ice uses and requires STLPort only for the Visual Studio 6 build, itself used only for Ruby support on Windows. So, a better check would be:
    #if defined(_MSC_VER) && (_MSC_VER < 1300) && !defined(NDEBUG)
    ...
    

    Note that we can't tell at this point whether or not we use STLPort, since this header should be processed before the inclusion of any STLPort header.

    Hopefully we will able to use a more recent C++ compiler to support Ruby for the next Ice release, and remove all STLPort-related pre-processing directives.

    Best regards,
    Bernard
  • julienjulien Member Julien GueganOrganization: LombardOdier & cieProject: bank software for portfolio management
    Hi Bernard,

    Thanks for your reply.
    We are on Visual Studio 2010 so the fix you propose would definitely work for us. I hope you can add this in time for ICE 4.0.


    Regards,
    Julien
Sign In or Register to comment.