[Info-vax] C... the only winning move is not to play...
hb
end.of at inter.net
Mon Feb 10 03:35:45 EST 2014
On 02/10/2014 12:17 AM, VAXman- @SendSpamHere.ORG 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? I've
> used other routines from this library without issue save for this one. Is
> there a #pragma that allows for or provides this? I've read the on-line
> help but don't see anything under #pragma.
>
What's the problem? Something like ...
$ cre x.h
int foo (int,int);
[ Exit ]
$ cre x.c
#include "x.h"
int bar (void) { return foo(1,2,3)+foo(1,2,3,4); }
[ Exit ]
$ cc x
int bar (void) { return foo(1,2,3)+foo(1,2,3,4); }
........................^
%CC-E-TOOMANYARGS, In this statement, "foo" expects 2 arguments, but 3
are supplied.
at line number 2 in file DISK$USER:[USER]x.c;1
int bar (void) { return foo(1,2,3)+foo(1,2,3,4); }
...................................^
%CC-E-TOOMANYARGS, In this statement, "foo" expects 2 arguments, but 4
are supplied.
at line number 2 in file DISK$USER:[USER]x.c;1
$
You can just #define the function to something totally different, #undef
it later and add the correct prototype, like
# define foo(x,y) unusedAndUseless
#include "x.h"
# undef foo
int foo (int,int,...);
int bar (void) { return foo(1,2,3)+foo(1,2,3,4); }
$ cc x
$
More information about the Info-vax
mailing list