Commit Graph

15 Commits

Author SHA1 Message Date
christos d79deccee9 Unfortunately lint uses c-style comments as directives and these get parsed
at the lexical analysis stage not at the syntax parsing stage. The upshot
is that:
	if (expr) {
		stmt1;
	}
	/* LINTED */
	stmt2;

stmt2 is the look-ahead token for the parser to choose between and if-then-else
statement as opposed to an if-then statement. Unfortunately the side effect
is that the LINTED directive gets reset before stmt2 gets parsed. We fix this,
by remembering the the linted directive during the if statement parsing and
restoring it at the appropriate time.
1998-11-23 14:37:08 +00:00
christos e79f03e595 Fix problems with LINTED comment:
if (a) b;
	/*LINTED*/
	c;

	if (a) { b; }
	/*LINTED*/
	c;

	do { b; }
	/*LINTED*/
	while (c);

Produced warnings for c.
1998-11-13 16:48:01 +00:00
christos a06495e3c4 WARNSify 1998-02-22 15:40:39 +00:00
cjs 8b57d60845 I do wish people would start including <string.h> when they use memcpy. 1997-11-06 15:47:23 +00:00
cgd f9356d1960 implement (hack in) symbol (function and variable) renaming, so that
the function renaming tricks currently needed by libc can be tolerated
by lint.  This needs some cleanup, but it appears to work.
1997-11-03 22:36:31 +00:00
mycroft 70f7fd1f59 Hack to work around compiler bug for now. 1997-05-09 18:07:23 +00:00
cgd e8685ee836 * Accept asm statements at any place where you could see a function or
variable declaration, in addition to within function & variable
  declarations and function bodies.  I think this comes close enough
  to what gcc does to be considered "correct enough."  Certainly, it
  fixes the problem for the couple of cases where this is a problem
  in our tree.
1996-12-22 11:30:49 +00:00
jpo ffe990841c don't print warnings about unused variables or arguments in compound
statements which contain asm statements.
1995-10-02 17:31:35 +00:00
jpo 5888f3bb16 LINTED and CONSTCOND are now valid up to the next end of a
global or local declaration/definition/statement. Originally they were
valid on the current and next line, which made it hard to suppress
warnings in constructs with more then one line.

LONGLONG can now be used to suppress errors or warnings in the next
declaration, definition or statement.
1995-10-02 17:29:45 +00:00
jpo b95167a01a support asm statements and asm modifiers in declarations
asm statements consist of an asm keyword, an optional qualifier, a
left paren, a list of tokens up to and including the matching right
paren, and a semicolon.

asm modifiers consist of an asm keyword, an left paren, a string and a
right paren.

asm statements and modifiers have no semantic for lint(1), they exist only
to avoid complaints about them.
1995-10-02 17:26:52 +00:00
jpo ef83266200 __{const,signed,volatile}{__,} added
const, signed and volatile are disabled with -t
1995-10-02 17:18:53 +00:00
jpo 2e332f67bf added inline keywords
"inline" is enabled by -g, "__inline" and "__inline__" are always available
1995-10-02 17:14:06 +00:00
jpo a5d55cc062 prefixed members of dinfo_t with 'd_' 1995-10-02 17:08:31 +00:00
cgd c61d16ddbe RCS id cleanup 1995-07-03 21:23:45 +00:00
cgd b14be51dec lint(1) implementation, by Jochen Pohl. named 'xlint' for a similar
reason to why 'install' is named 'xinstall'.
1995-07-03 20:56:35 +00:00