Operating System - HP-UX
1752782 Members
6198 Online
108789 Solutions
New Discussion

Error message for strrchr()

 
Rakesh Thakur
New Member

Error message for strrchr()

Hi.
I would like to keep this description short and simple…

In a source code I am using strrchr() as…
char * pvNameStr=strrchr(mName.c_str(),'/');

I tried to build this code with aCC compiler version “A.03.39” with ‘what’ string as
$Revision: 92453-07 linker linker crt0.o B.11.30 020412 $
HP aC++ B3910B A.03.39
HP aC++ B3910B A.03.33 Language Support Library
HP-UX version B.11.00.

The code complied without any error, but when I tried compiling it on aCC with version “A.03.73” with what string as…
$Revision: 92453-07 linker linker crt0.o B.11.47 051104 $
HP aC++ B3910B A.03.73
HP aC++ B3910B A.03.66 Classic Iostream Library
HP aC++ B3910B A.03.66 Language Support Library

and HP-UX version B.11.11; I got following error message …
“Cannot initialize ‘char *’ with ‘const char *’”

I know I need to collect the return val of strrchr() in const char *, but who come then it was supported on older aCC version?
Has then change been incorporated in later versions of aCC?

Thanks
Rakesh.

 

 

P.S. This thread has been moved from Itanium Based - Experts Online Now!!! to HP-UX > languages - HP Forums moderator

1 REPLY 1
Dennis Handly
Acclaimed Contributor

Re: Error message for strrchr()

The proper forum for aC++ questions is HP-UX > Languages:
http://forums.itrc.hp.com/service/forums/categoryhome.do?categoryId=150

Especially since you are asking about an obsolete PA-RISC compiler.

>I know I need to collect the return val of strrchr() in const char*, but who come then it was supported on older aCC version?

Because you used -AA, where before the Standard C++ strrchr overloads are missing with the default -AP.