A lint question

Paul Sutcliffe Jr. paul at devon.UUCP
Sun Dec 4 02:23:43 AEST 1988


In article <4881 at bsu-cs.UUCP> dhesi at 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 at devon.UUCP			  |   that has 1/3 less calories.   |
 or : ...rutgers!bpa!vu-vlsi!devon!paul	  +---------------------------------+



More information about the Comp.lang.c mailing list