[net.lang.c] using lint on `commercial' code

chris@umcp-cs.UUCP (Chris Torek) (05/05/86)

In article <531@bu-cs.UUCP> bzs@bu-cs.UUCP (Barry Shein) writes:
>A more interesting idea: Would it be reasonable to run a vendor's
>code you just bought through LINT and call their warranty dept if
>there was any serious bitching by lint?

The answer to that depends on the purpose for which the software
was sold (and bought).  In practice I suspect this would be entirely
unproductive:  You would spend all your time on the phone, and
never have a chance to use the software. . . .

Anecdote:  We had some Imagen software that was working on a Vax.
We moved the software to a Pyramid and it broke.  I ran lint on
the program in question.  Among the several hundred lines of other
errors, it pointed out the one that was causing the failure:

	struct foo {
		int i;
	} foo[128];

	caller()
	{
		...
		callee(foo[n]);
		...
	}

	callee(i)
		int i;
	{
		/* do something with i */
	}

This works on most machines; since the structure contains no `holes',
one member of that structure is the same size as one integer, and
the two can be treated as equivalent.  But the Pyramid has a register
window architecture, and passes `simple' arguments in registers,
reserving the data stack for `complex' arguments---such as (drum
roll please) structures.
-- 
In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 1415)
UUCP:	seismo!umcp-cs!chris
CSNet:	chris@umcp-cs		ARPA:	chris@mimsy.umd.edu