Path: utzoo!utgpu!watmath!clyde!att!rutgers!psuvax1!vu-vlsi!devon!paul
From: paul@devon.UUCP (Paul Sutcliffe Jr.)
Newsgroups: comp.lang.c
Subject: Re: A lint question
Summary: SysV vs BSD linting
Message-ID: <1165@devon.UUCP>
Date: 3 Dec 88 16:23:43 GMT
References: <4881@bsu-cs.UUCP>
Reply-To: paul@devon.UUCP (Paul Sutcliffe Jr.)
Organization: Devon Computer Services, Lancaster, PA
Lines: 32

In article <4881@bsu-cs.UUCP> dhesi@bsu-cs.UUCP (Rahul Dhesi) writes:
+---------
| [ size argument to malloc/read is (int) on BSD, (unsigned int) on SysV ]
| 
| (Sigh.)  You can't always make the same code lint properly under both
| SVR2 and 4.3BSD because of this.  Damned if I do, unsigned if I don't.
+---------

Oh?  How about:

    #ifdef BSD
    #define SIZE    int
    #else
    #define SIZE    unsigned int
    #endif

    ...

    foo = malloc((SIZE)bar);

    ...

I realize that using the word SIZE may not be appropriate.  If you
agree with this, substitute your favorite word in its place.

- paul

-- 
Paul Sutcliffe, Jr.			  +---------------------------------+
					  | Light Year, n.:  A regular year |
UUCP: paul@devon.UUCP			  |   that has 1/3 less calories.   |
 or : ...rutgers!bpa!vu-vlsi!devon!paul	  +---------------------------------+