www.digitalmars.com         C & C++   DMDScript  

c++.stlsoft - STLSoft and Insure++

reply Mike Batten <mike m-batten.wanadoo.co.uk> writes:
We have started using Pantheios/STLSoft on our project. However, we have 
started to find that it is causing conflicts with Insure++, our code 
analysis tool.  Is this an known problem?  Can any one give any advise? 
  We are using versions of Pantheios and the STLSoft libraries from a 
few months ago (don't know the exact versions at the moment but could 
check if this is important). xfgvxf

Regards,

Mike Batten.
Apr 30 2007
parent reply "Matthew Wilson" <matthew hat.stlsoft.dot.org> writes:
Hi Mike

I've never used Insure++, so can't comment directly.

However, if you could give information on the conflicts (and let me know
what version(s) you're using), that might spark some insight.

FWIW, I'm not totally surprised by this. There are some non-boilerplate
"features" in there that might confuse an automated tool, however
"enlightened" it might be. Once again, details might help. ;-)

Cheers

Matt

"Mike Batten" <mike m-batten.wanadoo.co.uk> wrote in message
news:f15hh3$1hvb$1 digitalmars.com...
 We have started using Pantheios/STLSoft on our project. However, we have
 started to find that it is causing conflicts with Insure++, our code
 analysis tool.  Is this an known problem?  Can any one give any advise?
   We are using versions of Pantheios and the STLSoft libraries from a
 few months ago (don't know the exact versions at the moment but could
 check if this is important). xfgvxf

 Regards,

 Mike Batten.
Apr 30 2007
parent reply Mike Batten <mike m-batten.wanadoo.co.uk> writes:
Hi Matt,

Thanks for the reply.  I have reproduced the error we are getting with 
our main program in one of your examples, example_cpp_file.  The main 
error from Insure++ appears to be:

[constraints.hpp:225] **PARSE_ERROR**

   Parse error.
         STLSOFT_SUPPRESS_UNUSED(i);
a template argument may not reference a local type This was generated with pantheios-1.0.1-beta22 and stlsoft-1.9.1-beta42 although I have also confirmed the error with pantheios-1.0.1-beta26 and stlsoft-1.9.1-xstlv1 I have attached a zip file containing the source code, makefile, and make log from the build. The make log also contains references to a number of 'undefined' symbols. This was built on a Linux (Red-Hat) platform. If we cannot get this sorted then we will be faced with either writing a noddy 'do nothing' substitute module for Pantheios, for when we want to use Insure++, or taking Pantheios out, which I would rather not happen. Regards, Mike. Matthew Wilson wrote:
 Hi Mike
 
 I've never used Insure++, so can't comment directly.
 
 However, if you could give information on the conflicts (and let me know
 what version(s) you're using), that might spark some insight.
 
 FWIW, I'm not totally surprised by this. There are some non-boilerplate
 "features" in there that might confuse an automated tool, however
 "enlightened" it might be. Once again, details might help. ;-)
 
 Cheers
 
 Matt
 
 "Mike Batten" <mike m-batten.wanadoo.co.uk> wrote in message
 news:f15hh3$1hvb$1 digitalmars.com...
 We have started using Pantheios/STLSoft on our project. However, we have
 started to find that it is causing conflicts with Insure++, our code
 analysis tool.  Is this an known problem?  Can any one give any advise?
   We are using versions of Pantheios and the STLSoft libraries from a
 few months ago (don't know the exact versions at the moment but could
 check if this is important). xfgvxf

 Regards,

 Mike Batten.
May 01 2007
next sibling parent Mike Batten <mike m-batten.wanadoo.co.uk> writes:
P.S.

I forgot to attach the attachment!

Mike.


Mike Batten wrote:
 Hi Matt,
 
 Thanks for the reply.  I have reproduced the error we are getting with 
 our main program in one of your examples, example_cpp_file.  The main 
 error from Insure++ appears to be:
 
 [constraints.hpp:225] **PARSE_ERROR**
 
   Parse error.
  >>         STLSOFT_SUPPRESS_UNUSED(i);
 a template argument may not reference a local type
 
 This was generated with pantheios-1.0.1-beta22 and stlsoft-1.9.1-beta42 
 although I have also confirmed the error with pantheios-1.0.1-beta26 and 
 stlsoft-1.9.1-xstlv1
 
 I have attached a zip file containing the source code, makefile, and 
 make log from the build.  The make log also contains references to a 
 number of 'undefined' symbols.  This was built on a Linux (Red-Hat) 
 platform.
 
 If we cannot get this sorted then we will be faced with either writing a 
 noddy 'do nothing' substitute module for Pantheios, for when we want to 
 use Insure++, or taking Pantheios out, which I would rather not happen.
 
 Regards,
 
 Mike.
 
 Matthew Wilson wrote:
 Hi Mike

 I've never used Insure++, so can't comment directly.

 However, if you could give information on the conflicts (and let me know
 what version(s) you're using), that might spark some insight.

 FWIW, I'm not totally surprised by this. There are some non-boilerplate
 "features" in there that might confuse an automated tool, however
 "enlightened" it might be. Once again, details might help. ;-)

 Cheers

 Matt

 "Mike Batten" <mike m-batten.wanadoo.co.uk> wrote in message
 news:f15hh3$1hvb$1 digitalmars.com...
 We have started using Pantheios/STLSoft on our project. However, we have
 started to find that it is causing conflicts with Insure++, our code
 analysis tool.  Is this an known problem?  Can any one give any advise?
   We are using versions of Pantheios and the STLSoft libraries from a
 few months ago (don't know the exact versions at the moment but could
 check if this is important). xfgvxf

 Regards,

 Mike Batten.
May 01 2007
prev sibling parent reply "Matthew Wilson" <matthew hat.stlsoft.dot.org> writes:
 Thanks for the reply.  I have reproduced the error we are getting with
 our main program in one of your examples, example_cpp_file.  The main
 error from Insure++ appears to be:

 [constraints.hpp:225] **PARSE_ERROR**

    Parse error.
  >>         STLSOFT_SUPPRESS_UNUSED(i);
 a template argument may not reference a local type
Ok, this is because, for some compilers, the macro STLSOFT_SUPPRESS_UNUSED expands to the invocation of the function template stlsoft::suppress_unused_func(). See lines 2085-2130 of stlsoft/stlsoft.h. What you try is to replace all of that with: #ifdef __cplusplus #else /* ? __cplusplus */ #endif /* __cplusplus */ Let me know how it goes.
 I have attached a zip file containing the source code, makefile, and
 make log from the build.  The make log also contains references to a
 number of 'undefined' symbols.  This was built on a Linux (Red-Hat)
 platform.

 If we cannot get this sorted then we will be faced with either writing a
 noddy 'do nothing' substitute module for Pantheios, for when we want to
 use Insure++, or taking Pantheios out, which I would rather not happen.
We wouldn't want that! :-) Cheers Matt
May 01 2007
next sibling parent "Matthew Wilson" <matthew hat.stlsoft.dot.org> writes:
[Sorry, didn't finish my point. See below.]

 [constraints.hpp:225] **PARSE_ERROR**

    Parse error.
  >>         STLSOFT_SUPPRESS_UNUSED(i);
 a template argument may not reference a local type
Ok, this is because, for some compilers, the macro STLSOFT_SUPPRESS_UNUSED expands to the invocation of the function template stlsoft::suppress_unused_func()
and the language does not allow a template to be applied to a local (function-scope) type. I think Insure++ may be incorrectly detecting something to be a local type that is not. Pantheios (and STLSoft) is tested on a wide variety of compilers, and non have reported any similar error, so it inclines me to think Insure++ is reporting a false positive. Whatever the case, the hack I suggest would fix it up. Fingers crossed! ;-)
. See lines 2085-2130 of stlsoft/stlsoft.h.
May 01 2007
prev sibling parent Mike Batten <mike m-batten.wanadoo.co.uk> writes:
Thanks Matt, that seems to have worked!  It does work with you example 
code. Neither myself or my colleagues have had tine to try it with out 
main program so far, but we believe it will.

I will be contacting the Parasoft, the makers of Insure++, to see if we 
can get an patch put into Insure++ to cover this, but it would be good 
if the STLSoft library could be amended to include a compile time 
switch, or similar, as an additional safeguard.  Any thoughts?  At the 
moment we are keeping two version of the library active, one with and 
one without the hack, but this could prove inconvenient if we ever need 
to advance to a later version at some future date.

Thanks Again.

Mike Batten.

Matthew Wilson wrote:
 Thanks for the reply.  I have reproduced the error we are getting with
 our main program in one of your examples, example_cpp_file.  The main
 error from Insure++ appears to be:

 [constraints.hpp:225] **PARSE_ERROR**

    Parse error.
  >>         STLSOFT_SUPPRESS_UNUSED(i);
 a template argument may not reference a local type
Ok, this is because, for some compilers, the macro STLSOFT_SUPPRESS_UNUSED expands to the invocation of the function template stlsoft::suppress_unused_func(). See lines 2085-2130 of stlsoft/stlsoft.h. What you try is to replace all of that with: #ifdef __cplusplus #else /* ? __cplusplus */ #endif /* __cplusplus */ Let me know how it goes.
 I have attached a zip file containing the source code, makefile, and
 make log from the build.  The make log also contains references to a
 number of 'undefined' symbols.  This was built on a Linux (Red-Hat)
 platform.

 If we cannot get this sorted then we will be faced with either writing a
 noddy 'do nothing' substitute module for Pantheios, for when we want to
 use Insure++, or taking Pantheios out, which I would rather not happen.
We wouldn't want that! :-) Cheers Matt
May 02 2007