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

John E. Malmberg wb8tyw at qsl.network
Sun Feb 9 22:09:27 EST 2014


On 2/9/2014 8:09 PM, VAXman- @SendSpamHere.ORG wrote:
>
> Grrr... I have to build against VMS version variants back to V7.2 for this
> particular project.
>
> I guess that what I will do is make this code "fuglier" to work around the
> bad prototype.  The problem is basically an RTL with two mandatory args and
> a litany of optional args.  The C prototype only defines the two mandatory
> args; it should have a third __optional_params in the prototype but, sadly,
> it's been elided.

I expect that you have verified that there is not a special macro that 
if defined that changes the prototype exposed for that call.

The CRTL does in places that so that source code that expects past 
behavior, even if may not be according to the current standard continues 
to work.

To reprototype foo() in foobar.h:

#define foo hide_foo
#include <foobar.h>
#undef foo
/* Fixed prototype */
type_x foo(arg_t, arg_t, ...);

If you have a reasonbly current C compiler (Alpha), there is a 
/first_include option that can pull in a header file with these hacks.

On the vms-ports project, we are building a list of known issues and 
work arounds, and would be interested in knowing which call is 
miss-prototyped and needs to be worked around.

Regards,
-John
wb8tyw at qsl.network
Personal Opinion Only




More information about the Info-vax mailing list