ado@elsie.UUCP (Arthur David Olson) (11/22/85)
Index: cmd/mip/optim.c Fix
Description:
4.?BSD lint gives bogus diagnostics for enum pointer arguments.
Repeat-By:
Create a file named "try.c" with these lines in it:
enum foo {a,b,c};
try(bar)
enum foo * bar;
{
try(bar);
}
Then use the command
lint try.c
and note the output:
try, arg. 1 used inconsistently try.c(5) :: try.c(6)
Fix:
The problem occurs because pass 1 of the C compiler changes pointers
to enums to other ilks of pointers; while this simplifies code
generation for the compiler, it messes up "lint"s efforts to check
types. The fix is to conditionalize a line of code in "optim.c".
Here's the line from "optim.c" involved; the trade secret status of
the code involved precludes a clearer posting.
#ifdef OLDVERSION
if( (t=BTYPE(p->in.type))==ENUMTY || t==MOETY ) econvert(p);
#else
#ifndef LINT
if( (t=BTYPE(p->in.type))==ENUMTY || t==MOETY ) econvert(p);
#endif
#endif
--
Lint is an Oscar Madison trademark.
Bugs is a Warner Brothers trademark.
--
UUCP: ..decvax!seismo!elsie!ado ARPA: elsie!ado@seismo.ARPA
DEC, VAX and Elsie are Digital Equipment and Borden trademarks