string.h and std_cstring.h
gp@qnx.com
gp@qnx.com
Fri Aug 2 20:12:00 GMT 2002
Thanks, Joe. That could be it. Our header has something like:
#ifdef _cplusplus
#define Const_ret const
#else
#define Const_ret
#endif
..
..
extern Const_ret char* strrchr(Const_ret char *, int);
..
..
So if I am remembering it right (I'm at home right now), then we get one or
the other, but never both. I am not sure about the inlines, but I will check.
I will work on it and let you all know.
Thanks again.
GP
Joe Buck <Joe.Buck@synopsys.com> said:
>
> > I am working on the QNX i386-nto support in gcc again.
> >
> > The current stumbling block is that our string.h declares
> > memchr, strchr, strpbrk, strrchr, and strstr as inline.
> > ...
>
> > Comments? Am I missing something?
>
> It sounds like you may be running into trouble because C++ requires
> overloading for certain functions. For example, in C, strchr is
>
> char* strrchr(const char *, int);
>
> while in C++ there are two:
>
> const char* strrchr(const char *, int);
> char* strrchr(char *, int);
>
> So, if your OS provides only a C version of strchr, you still have
> work to do to get the C++ versions right.
>
>
--
More information about the Gcc
mailing list