Patches to 3.2.3 for HP-UX 11.23/IA, SGI C++ compiler

Albert Chin kdevelop-devel at mlists.thewrittenword.com
Mon Jan 23 17:35:07 UTC 2006


On Mon, Jan 23, 2006 at 03:18:07PM +0300, Vladimir Prus wrote:
> > 10. [languages/cpp/debugger/framestackwidget.cpp]
> >     strchr() returns a const on these platforms.
> 
> I could apply this one, but in /branches/kdevelop/3.4 state that file has
> some more calls to "strchr", and in some cases the returned pointer is
> actually used to modify the string.

We get the following errors from the compiler for the above file:
"framestackwidget.cpp", line 194: error #2144: a value of type "const char *"
          cannot be used to initialize an entity of type "char *"
          if (char *paramStart = strchr(frameData, '('))
                                 ^
"framestackwidget.cpp", line 196: error #2144: a value of type "const char *"
          cannot be used to initialize an entity of type "char *"
              char *fnstart = paramStart-2;
                              ^
> Any change you could compile that branch and see what changes are necessary
> in that case.

There is no difference between framestackwidget.cpp in the 3.4 branch
and the version in kdevelop-3.2.3.tar.bz2.

> Also, can you clarify that this is a workaround for a *bug* in HP-UX
> compiler/library? Is that bug reported to them?

HP-UX has the following prototypes for strchr():
  extern "C" const char* strchr(const char *, int);
  inline char* strchr(char *s, int c) {
    return const_cast<char*> (strchr(const_cast<const char*>(s), c));
  }

The strchr() errors above are because the first strchr() is picked up.
The earlier instances of strchr() are because the second is picked up,
which are ok.

So, no bug in the compiler.

-- 
albert chin (china at thewrittenword.com)




More information about the KDevelop-devel mailing list