Operating System - OpenVMS
1829535 Members
1644 Online
109992 Solutions
New Discussion

Strdup, strcasecmp, and strncasecmp

 
SOLVED
Go to solution
Arch_Muthiah
Honored Contributor

Strdup, strcasecmp, and strncasecmp

Steven,

I purposly added this /PREFIX=EXCEPT=AnyDuplicateCRTLFunction to avoid cimpilation errors and link time errors.

===================
list/mach/noopt/debug/define=("vms")/prefix=except=strnncasecmp/nomember/assume=noaligned_obj.
===================

I accept your idea of modifying only in two places. But as I said, this functions are being used in most of the programs, there are typedef declaration using this function, function return variables, etc...

Important thing here is that, we don't want to comment out this function declarations and definitions as we want to keep this 15 years old programs compatible for both VAX/VMS and Alpha/OpenVMS developement. __DECC, __CRTL_VER, and __VMS_VER conditions were already added for this purpose.

Except these new directives check, I don't have plan of touching the codes at this moment. Probably I may go with your suggestions once we get fresh requirements in the IInd qtr of 2006.

Archunan
Regards
Archie
2 REPLIES 2
Steven Schweda
Honored Contributor
Solution

Re: Strdup, strcasecmp, and strncasecmp

> [...] there are typedef declaration using
> this function [...]

Eh?

If you use the __CRTL_VER conditionality, you
could avoid your original problem, namely, a
mismatch between the system header file and
your function declaration, and you would not
need to change your function.

One way, you add a couple of directives to a
couple of files. The other way, you change
the same files plus the compile command. It's
your decision. There's almost always more
than one way to solve a problem (but my way
is usually better).

This exact method is used in the Info-ZIP
Zip program version 2.31 (and higher), and
(so far as I know) it gets built happily
from VMS V5.4 through V8.2, VAX C and DEC C
(specifying /PREFIX = ALL), on VAX, Alpha,
and IA64, at least. (Plus an old GNU C on
the VAX.) It seems to work pretty well.
Arch_Muthiah
Honored Contributor

Re: Strdup, strcasecmp, and strncasecmp

Steven,

Yes, we did not use __CRTL_VER check initially, for that we used /PREFIX=EXCEPT=xxx to bypass the compilation and linking warnings. It worked.

Thanks for Steven for your suggestions. I will come back to you if I have any more problems on this now and later when we may go for big enancement work probably in 2006.

Archunan
Regards
Archie