[OpenAFS-devel] Re: osi_Panic on AIX and IRIX

Andrew Deason adeason@sinenomine.net
Wed, 10 Feb 2010 00:19:26 -0600


On Tue, 9 Feb 2010 17:43:34 -0800
Chaz Chandler <clc31@inbox.com> wrote:

> 
> >> Not to remove them, but to surround them with ifdefs so that, on
> >> those platforms, osi_Panic is in the proper form (always four
> >> args).
> > 
> > Taking Simon's suggestion to declare osi_Panic to take an
> > unspecified number of arguments ('extern void osi_Panic();') would
> > prevent that need, and would avoid a compilation error.
> 
> I don't think I'm explaining this very well, so here's an example:
> 
> In rx_kcommon.c, there are four references to osi_Panic (lines 264,
> 285, 977, & 1304) with varying numbers of arguments.  Because
> osi_Panic on aix/irix is implemented with a mandatory 4 arguments,
> these lines raise errors when compiling.

Yes, and osi_Panic on aix/irix taking 4 arguments is wrong, it is a bug
(as far as I can tell, unless someone claims otherwise). Change it to
take an unspecified number of arguments.

That is, change the declaration in rx_prototypes.h to read

extern void osi_Panic();

(or just remove the declaration in rx_prototypes.h, the default is 'int
osi_Panic()' anyway, which is close enough) and keep the definition of
the function in rx_kcommon.c (or wherever; I'm not looking at the source
right now) as it is, something like:

void
osi_Panic(char *msg, void *a1, void *a2, void *a3)
{
   if (!msg) { msg = "whatever"; }
	printf(msg, a1, a2, a3);
	panic(msg);
}

or whatever it is. I'm not sure how to be more clear, but maybe I'm
still just not understanding you.

> I don't see how it compiles on AIX, so I must be missing something!

I don't see how it compiles on aix earlier than 6.1 either, but I
haven't looked too closely. On AIX 6.1, there is no prototype for
osi_Panic, which would explain it working there.

-- 
Andrew Deason
adeason@sinenomine.net