- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - OpenVMS
- >
- HP C RTL routine strncasecmp declaration
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-23-2005 06:14 AM
11-23-2005 06:14 AM
Env: OpenVMS 7.3-2/Alpha DS10, HP C V6.5.
strncasecmp funtion in string.h( DECC$RTLDEF.TLB) declared as int strncasecmp( const char *, const char *, __size_t)
But the DCL help says int strncasecmp (const char *s1, const char *s2, size_t n)
I have strncasecmp funtion in my HP C program, declared as int strncasecmp (const char *s1, const char *s2, int n).
But I receive compilation error as "strncasecmp" is not compatible with the type of a declaration in DECC$RTLDEF.TLB.
strncasecmp declaration in string.h and DCL HELP shows difference. How to declare this function in my program? It looks me string.h has typo in declaring strncasecmp.
Archunan
Archie
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-23-2005 06:40 AM
11-23-2005 06:40 AM
Re: HP C RTL routine strncasecmp declaration
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-23-2005 06:52 AM
11-23-2005 06:52 AM
Re: HP C RTL routine strncasecmp declaration
You see my declaration syntax, and I have string.h included in my program. But the receive the error "not compatible functions".
Archunan
Archie
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-23-2005 07:18 AM
11-23-2005 07:18 AM
SolutionI'm not sure I understand why you're declaring the routine twice. Once in string.h and once by yourself. Are you trying to substitute your own routine?
string.h is correct. The third argument is of type "__size_t". If you read the code, you'll see that __size_t may be defined as size_t, but the implementation is free to define it as something else.
Look for yourself:
$ LIBRARY/EXTRACT=STRING SYS$SHARE:DECC$RTLDEF/TEXT/OUT=STRING.H
The reason for this is to make the compiler, and hence your code, less likely to be dependent on a particular hardware size for INTEGER or POINTER types (Hext's rule of programming: "One further level of indirection solves all problems")
Please explain why you need to redeclare the function, so I can work out what you're trying to achieve. Maybe post a small, but complete, code example that shows the error (by your description just a few lines will do)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-23-2005 08:35 AM
11-23-2005 08:35 AM
Re: HP C RTL routine strncasecmp declaration
I thought I can get your response tomorrow only since your time now in australia is night, and you will be sleeping. Thanks John for your response at this time.
I did not declare strncasecmp inside program, It is a old DEC C program developed in Alpha OVMS with previous C compiler version, Now I am trying to build.
I found no prototype declaration of strncasecmp function inside the CProg.
They are using this function as.....
int strncasecmp( char *s1, char *s2, int n)
I have already changed that function as ....
int strncasecmp( const char *s1, const char *s2, int n).
This gave compilation error as "strncasecmp is not compatible with the type of a declaration in DECC$RTLDEF.TLB"
So can I use this functions as ...
int strncasecmp( const char *s1, const char *s2, size_t n)?.
Because if I change the 3rd argument as
"size_t n", the compilation successful.
Archunan
Archie
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-23-2005 08:52 AM
11-23-2005 08:52 AM
Re: HP C RTL routine strncasecmp declaration
> program, It is a old DEC C program
> developed in Alpha OVMS with previous C
> compiler version, Now I am trying to build.
> They are using this function as.....
>
> int strncasecmp( char *s1, char *s2, int n)
I think that's called declaring the function.
It's not clear from your description, but we
might assume that the old code includes an
actual strncasecmp() function, because it was
not available in older C RTL versions.
If that's true, you can throw it away.
Alternatively, you can bracket the old
function with directives like:
#if __CRTL_VER < 70000000
[old strncasecmp() code]
$endif /* __CRTL_VER < 70000000 */
That way, when the old code is needed, it
will be used, and when strncasecmp() is in
the C RTL, the program will use that one.
There are even more clever methods to improve
portability of the object code, but that's
another lesson.
Look at the header file (string.h) to get the
proper conditionality.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-23-2005 09:55 AM
11-23-2005 09:55 AM
Re: HP C RTL routine strncasecmp declaration
> int strncasecmp(char *s1,char *s2,int n)
> I think that's called declaring the
> function.
This is not the declaration statement Steve. also no need to declare any RTL functions inside any program if we include the respective *.h file. There will be a function body after "int strncasecmp()".
I mentioned, after I change the third argument "int n" to "size_t n", the compilation went thru successfully. I asked Mr.John that whether can I change "int n" to "size_t n"?
< Alternatively, you can bracket the old
< function with directives like:
< #if __CRTL_VER < 70000000
< [old strncasecmp() code]
< $endif /* __CRTL_VER < 70000000 */
The latest OS comming with updated RTLs, so
we don't need to worry about __CRTL_VER macro, because the important purpose of this macro is to provide the required C RTL API and to categorise 32 and 64 bit support for the VMS where we compile. the compiler.
Archunan
Archie
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-23-2005 10:06 AM
11-23-2005 10:06 AM
Re: HP C RTL routine strncasecmp declaration
> [...] no need to declare any RTL functions
> inside any program if we include the
> respective *.h file.
True. So why is there anything like
"int strncasecmp(char *s1,char *s2,int n)"
in your code?
> There will be a function body after "int
> strncasecmp()".
In other words, the old code includes its own
strncasecmp() function? I repeat:
Throw it away.
> [...] we don't need to worry about
> __CRTL_VER macro [...]
Have it your way.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-23-2005 10:35 AM
11-23-2005 10:35 AM
Re: HP C RTL routine strncasecmp declaration
existing strncasecmp() function so that the
compiler is happy, what is your plan for
dealing with the MULDEF camplaints from the
linker? Hint: Throw it away.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-23-2005 10:51 AM
11-23-2005 10:51 AM
Re: HP C RTL routine strncasecmp declaration
Looks like you started enjoying the holidays!!!
Steve, please go through your last two responses, I already said compilation went thru successfully. I just asked Mr.John that changing "int n" to "size_t n" will be ok? Nothing more than that. But you yourself trying to get clear something and eating my time. I already cleared that, I use this forum as a alternate to HP support. Not for unneccessary arguments.
There are so many things involved using RTL functions, user written functions, functions overloading and using C++ compiler to compile CProg. Now I don't have time, if I have problem, certainly I will be with those type of questions.
Have a peacefull holiday session!!!
Archunan
Archie
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-23-2005 10:58 AM
11-23-2005 10:58 AM
Re: HP C RTL routine strncasecmp declaration
> since your time now in australia is night,
Maybe it's a different Australia from the one you're thinking of ;-) It's definitely day here. Both now, and when I responded earlier :-)
I have to strongly agree with Steven, you should simply remove all declarations of strncasecmp from your code. Indeed, all lines of code than mention strncasecmp, except those that are calling it. Just make sure you have:
#include
and it should all "just work".
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-23-2005 11:02 AM
11-23-2005 11:02 AM
Re: HP C RTL routine strncasecmp declaration
Thanks for your time.
after I changed the third arg from "int n" to "size_t n", the compilations was successfull.
I wanted to give minus point to Steve for his unnecessary interruption without concerning about to my question, but there is no 'minus point' option for that.
Though I need confirmation from John, I wanted to close this thread urgently, otherwise I will be flooded with Stev'e unnecessary questions and blaming.
Thanks
archunan
Archie
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-23-2005 11:30 AM
11-23-2005 11:30 AM
Re: HP C RTL routine strncasecmp declaration
I asked some other thing. The question left unanswered was about changing "int n" to "size_t n".
Archunan
Archie
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-23-2005 11:59 AM
11-23-2005 11:59 AM
Re: HP C RTL routine strncasecmp declaration
> changing "int n" to "size_t n".
The answer was:
"[...] [Y]ou should simply remove all
declarations of strncasecmp from your code."
You didn't seem to like that one (from him or
from me), but that's the answer.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-24-2005 07:29 AM
11-24-2005 07:29 AM
Re: HP C RTL routine strncasecmp declaration
Yesterday itself, I compiled, linked, and tested. Now I am out of that CProg.
If you have any doubt or if you don't like my CProg to work or if you interested in arguments, I am not available to arguments, but you can catch HP support personal for your new doubts, or lodge a complaint with HP on "how can Archunan's CProg be worked".
Please don't drag me further on this thread.
Archunan
Archie
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-24-2005 08:48 AM
11-24-2005 08:48 AM
Re: HP C RTL routine strncasecmp declaration
>Please don't drag me further on this thread.
Sorry, I have to agree with Steven on this. You asked for our advice, we gave it, but you're now arguing why you're right and we're wrong!
If your program still contains any definition for strncasecmp then it's wrong. Plain and simple. Yes it might compile cleanly and "work" now, but that doesn't make it correct. Sometime down the track it may stop working. If you remove the definition(s), your program will be correct, and it will continue to work in future versions.
Hint... if you don't like the advice, that's your business, but the way you've responded in this thread will make me think twice before taking up my time composing answers to your future questions.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-24-2005 10:38 AM
11-24-2005 10:38 AM
Re: HP C RTL routine strncasecmp declaration
I always have good impressions on you, infact when I post my question, I was expecting any suggestions especially from you.
please go thru my responses, Before I see your first response, I mentioned my Cprog compiled successfully after changing "int n" to "size_t n". After this, I saw your response, but anyway I assigned points for your response; respecting your valuable time and suggestions.
I started this thread with "I receive
--COMPILTION-- error as strncasecmp is not compatible with the type of a declaration in DECC$RTLDEF.TLB". Please do go through Mr.Steven responses, he has entered after I said "no compilation error"; after everything is solved, he tries to create new questions where I need no advices and clever lessions. I observe from starting onwords, he loves arguments and blaming other members. Instead of concentrating and blaming others members responses, he better can concentrate giving suggestions on the intial customer's question. Forum members posting their questions with the expectations of getting quick answer (quicker than HP customer support or going through our HP excellent documents). If we argu on each other's answers irresponsibly, then one our forum member who waits for answer, will lose his one customer.
even now I would like to use/respect this forum as alternate to HP support, not for any --ARGUEMENTS and BLAMING --, there are so many forums in the net for arguments, blaming and technical research. But I would like "THIS FORUM" to be difft.
Bear with me John if my expectations from this forum differs.
Archunan
Archie
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-24-2005 04:04 PM
11-24-2005 04:04 PM
Re: HP C RTL routine strncasecmp declaration
Why do take a simple correction as a personal
insult?
> Please do go through Mr.Steven responses,
> he has entered after I said "no
> compilation error"; [...]
Note that _I_ was the first one to mention
linking. You initially said it had been
compiled, not that it had also been linked.
As most of us are not members of the Psychic
Friends Network, we are forced to work with
the information you give us, not with all the
information you might have.
Mr. Gillings was correct (as was I) when he
said that there is no good reason for you to
have any declaration of strncasecmp() in
your program. I'm sure that we would all be
open to a good counter-argument, but I don't
expect one. As always, you are free to
ignore any advice you get here, no matter
how good (or bad) it might be.
> How to declare this function in my program?
"If
still the right answer, what ever you think
of me (or anyone else) personally.
My personal advice would be, "Grow up.", but
you're free to ignore that, too.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-24-2005 08:09 PM
11-24-2005 08:09 PM
Re: HP C RTL routine strncasecmp declaration
Maybe it will be better if you all take a 24 hour timeout before reacting again.
To all 3:
From the sideline it looks like your deepest arguments are linguistic.
Please try to get the intensions behind each others postings, before reacting to your own interpretations of the literal text.
I know that is more difficult, but clearly we all do not have the same agility with English. Foreign languages CAN pose extra problems!
Please - no more personal attacks in this forum.
Oke?
Proost.
Have one on me.
jpe
PS - Zero points for this, please.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-25-2005 09:05 AM
11-25-2005 09:05 AM
Re: HP C RTL routine strncasecmp declaration
options /PREFIX or /STANDARD? That could
affect the results.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-30-2005 07:51 AM
11-30-2005 07:51 AM
Re: HP C RTL routine strncasecmp declaration
My C prog compilation (using C++) qualifier is
/list/mach/noopt/debug/define=("vms")/prefix=except=strnncasecmp/nomember/assume=noaligned_obj.
I like to use this /prefix=except="AnyDuplicateRTL", because if I suggest for modification as you suggested, it is a big modification work for almost 9000 programs. The "type" and "size" of those arguments used in the duplicate RTL functions, are being used in so many places throught so many programs.
As everything is a business, I did not want to disclose this in this forum. I am sorry if my posting hurted any one.
Thanks Steve
Archunan
Archie
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-30-2005 02:24 PM
11-30-2005 02:24 PM
Re: HP C RTL routine strncasecmp declaration
That explains why you did not get the LINK
problems I expected. This means that you are
still using your own strncasecmp(), not the
one in the (new) C RTL.
> if I suggest for modification as you
> suggested, it is a big modification work
> for almost 9000 programs.
The modifications I suggested should have
been limited to two files:
1. Where the actual strncasecmp() function
code was.
2. The (non-system) header file where
strncasecmp() was declared (before it
appeared in
If you need to change any more files, then
you might think about restructuring the
code.