A lint question

James Logan III logan at vsedev.VSE.COM
Tue Nov 29 01:26:06 AEST 1988


I am having a problem with lint that I'm sure you have all seen
before.  I have 3 calls to the read() function and one call to
malloc() which are all used in the same way (same number and type
of arguments), yet lint has this complaint:  

function argument ( number ) used inconsistently
    malloc( arg 1 )   	llib-lc(338) :: findlinks.c(114)
    read( arg 3 )   	llib-lc(104) :: findlinks.c(127)

I assume that lint is telling me that I am calling malloc() and
read() with an inconsistent number or parameters.  How can I be
inconsistent with the number of parameters with one call to
malloc()?  The calls look like this:  

extern char *malloc();
char *directory;
directory = (char *)malloc((int)stbuf.st_size);

if (read(fd, directory, (int)stbuf.st_size) != (int)stbuf.st_size) {
	.
	.
	.
}
while (read(fd, &mntbuf, sizeof(MNT)) == sizeof(MNT)) {
	.
	.
	.
}
while (read(fd, nextentry, sizeof(nextentry)) == sizeof(nextentry)) {
	.
	.
	.
}

They look pretty consistent to me, especially in the argument
count!  Any help would be appreciated.  Thanks in advance.  

			-Jim
-- 
Jim Logan		logan at vsedev.vse.com
(703) 892-0002		uucp:	..!uunet!vsedev!logan
			inet:	logan%vsedev.vse.com at uunet.uu.net



More information about the Comp.lang.c mailing list