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

Vladimir Prus ghost at cs.msu.su
Tue Jan 24 08:28:04 UTC 2006


On Monday 23 January 2006 19:33, Albert Chin wrote:

> > 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.

I see why other strchr does cause problems. Thanks, the patch to 
framestackwidget.cpp is now comitted, in revision 501878 
on /branches/kdevelop/3.4/languages/cpp/debugger

> So, no bug in the compiler.

I'm afraid there is. The C standard gives the following prototype for strchr:

    char *strchr(const char *s, int c);

and:

1. No prototype in your compiler matches the above.
2. I'm pretty sure C implementation is not allowed to add extra overloads that 
change the meaning of programs.

I'd really suggest you report this as bug.

- Volodya






More information about the KDevelop-devel mailing list