mcbain@latcs1.oz (Mike McBain) (10/05/87)
The recent posting of the C source database system looks like a really
useful piece of software. While there seem to be some traps for
the unwary SysV user associated with dir.h vs ndir.h, there is a
portability and/or reality problem with at least one line in lid.c.
In that file occurs the following line:
if ((doit == lookId && !forceMerge).....
The problem with this expression is that doit is a pointer and lookId is
a pointer to function. Why is this a problem? Because K&R do not actually
state whether or not a function has an address that can be pointed to.
So my compiler (on a National Semiconductor 3216) comes up with the
'incompatible arguments'. This problem can be solved with the following
cast expression;
if ((doit == (void(*)())lookId && !forceMerge)
which should work for everyone. This may be an obscurity, but is also
part of both the pleasure and the pain of a language like C
Mike McBain, ISD: +61 3 479-2393
Department of Computer Science, STD: (03) 479-2393
La Trobe University, ACSnet: mcbain@latcs1.oz
Bundoora, CSnet: mcbain@latcs1.oz
Victoria, 3083, ARPA: mcbain%latcs1.oz@uunet.uu.net
Australia UUCP: ...!uunet!munnari!latcs1.oz!mcbain
hplabs
mcvax
ukc
nttlab