[Info-vax] C... the only winning move is not to play...

JohnF john at please.see.sig.for.email.com
Mon Feb 10 07:49:58 EST 2014


VAXman- wrote:
> I've encountered a VMS library call prototype that is incorrect.
> How can I override/overwrite the prototype in my source
> to make it correct?
> 
> OK.  The function is STR$CONCAT.
> somewhere VMS pre-V8.*, where it's WRONG, WRONG, WRONG...
> #define  str$concat  STR$CONCAT
> #ifdef __NEW_STARLET
> unsigned int str$concat(
>        void *destination_string,
>        void *source_string);
> 
> and later VMS versions, where it's workable,...
> #define  str$concat  STR$CONCAT
> #ifdef __NEW_STARLET
> unsigned int str$concat(
>        void *destination_string,
>        void *source_string_1,
>        __optional_params);
> Now, if you can include <str$routines.h> and make this go away,
> I'm wanting.

Is that actual entry point uppercase?
You might (or might not) be able to get away with
something like
#define STR$CONCAT dummy
#include <str$routines.h>
whereby the prototype refers to a dummy() func.
Then
#undef STR$CONCAT
#redefine str$concat STR$CONCAT
and prototype the actual func any way you like.

But I've got to ask: why would you/anybody use vms-specific
library stuff for ansi-standard functionality?
Besides job security, that is?
I recall some code I became responsible for, where after
reading through several pages of rms stuff, it dawned on
me the guy could just have done an fopen()/fprintf()'s.
It was ridiculous to write it the way he did.
   I'm too lazy to look up what those optional args
might be doing for you, but the "real solution" here
is to replace str$concat() with ansi-standard strcat() 
wherever possible. Modulo job security, that is.
-- 
John Forkosh  ( mailto:  j at f.com  where j=john and f=forkosh )



More information about the Info-vax mailing list