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

Chaz Chandler clc31@inbox.com
Wed, 10 Feb 2010 08:29:54 -0800


>>=20
>> I don't think I'm explaining this very well, so here's an example:
>>=20
>> 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.
>=20
> 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.
>=20
> That is, change the declaration in rx_prototypes.h to read
>=20
> extern void osi_Panic();

Yes, done -- Derrick's submitted a patch which removes the prototype on =
irix.  That's not the issue.  The prototype is a red herring.  That's not =
what's causing the problems in rx_kcommon mentioned above, where there are =
references to osi_Panic with one or two args instead of always four.  =
Because these references occur in places which are also compiled on aix =
and irix, they should fail to compile.  Indeed, they do on irix.  I don't =
see how they don't on aix, but I'm not really concerned about that.  I =
just want to find the best way forward for all platforms.  That's why I'm =
asking here.  I'm happy to do something like this for all rx_kcommon =
osi_Panic()s:

=23if defined(AFS_AIX_ENV) =7C=7C defined(AFS_SGI_ENV)
        osi_Panic(=22osi_AssertFailK: error in osi_utoa()=5Cn=22, =20
                NULL, (void *)NULL, (void *)NULL);
=23else
        osi_Panic(=22osi_AssertFailK: error in osi_utoa()=5Cn=22);
=23endif

which does compile.  I just thought that perhaps there was a more general =
solution, like a change to osi_Panic itself.  For instance, I believe irix =
does support stdarg in the kernel.  It doesn't have v*printf, but it has a =
function that could be used in its stead (cmn_err(), see link below) which =
does take va.

http://techpubs.sgi.com/library/tpl/cgi-bin/getdoc.cgi?coll=3D0650&db=3Dman=
&fname=3D/usr/share/catman/p_man/catD/cmn_err.z

-Chaz

____________________________________________________________
FREE 3D MARINE AQUARIUM SCREENSAVER - Watch dolphins, sharks & orcas on =
your desktop=21
Check it out at http://www.inbox.com/marineaquarium