[splint-discuss] Patch for splint to compile on mac os x

Richard A. O'Keefe ok at cs.otago.ac.nz
Wed Aug 6 19:02:20 PDT 2008


On 7 Aug 2008, at 6:59 am, Marian Such wrote:

> Hello,
> here is patch to make splint compile without error on Mac OS X.
>
> # diff -u src/osd.c src/osd_new.c

Err, I have splint building in another window on a Mac OS X machine
right now.  osd.c *did* compile without error, without needing any
patch. ... Yup, the whole thing built straight out of the box without
needing any changes at all.

> --- src/osd.c   2007-07-14 00:18:20.000000000 +0200
> +++ src/osd_new.c       2008-08-06 20:41:21.000000000 +0200
> @@ -515,6 +515,8 @@
>  {
>  # if defined (WIN32) || defined (OS2) && defined (__IBMC__)
>    int pid = _getpid ();
> +# elif __APPLE__
> +  __darwin_pid_t pid = getpid ();
>  # else
>    __pid_t pid = getpid ();
>  # endif

The code I see in a straight-out-of-the-box 3.1.2 distro is

# if defined (WIN32) || defined (OS2) && defined (__IBMC__)
int
# else
int /* pid_t */
# endif
osd_getPid ()
{
# if defined (WIN32) || defined (OS2) && defined (__IBMC__)
   int pid = _getpid ();
# else
   pid_t pid = getpid ();
# endif

   return (int) pid;
}

The *right* name for the type is indeed 'pid_t', not
'__pid_t', as the Mac OS X 'man getpid' says (and as
POSIX says also).

Which version of SPlint?    [for me, 3.1.2]
Which version of Mac OS X?  [for me, 10.5.4]
Which version of XCode?     [for me, 3.0]




More information about the splint-discuss mailing list