Commit Graph

59 Commits

Author SHA1 Message Date
mycroft 6ea1997e79 Fix problem building lint.7. 2000-07-23 22:17:14 +00:00
christos 6fa36b3bb7 better way to handle lint.7 2000-07-06 01:21:46 +00:00
christos ab89a2b0b0 build lint.7 man page 2000-07-06 01:11:23 +00:00
christos 4017aef2ee add 3 new flags:
-m print message list
-X <id>[,<id>]... suppress error messages with give ids.
-w treat warnings as errors.
2000-07-06 01:10:51 +00:00
christos 86cf133f3b new function and new flag... 2000-07-06 01:09:56 +00:00
christos 2e6af79a57 - support for -X flag
- support for -m flag
- print the error number in each message
2000-07-06 01:09:20 +00:00
christos 3c68257297 new script to generate a man page of error messages that lint generates 2000-07-06 01:08:10 +00:00
christos 5c2e510661 Prevent lint1 from coredumping on invalid c code such as:
foo((sockaddr *(void *))0);

This fix is imperfect, because right now we just check the subtype
chains for NULL and we return to the caller when the loop ends, leaving
the upper layers to cope with the syntax error. Ideally we should:

	a.) return an error to the upper layer, or
	b.) not call the type analysis routines in the presence of a syntax
	    error.

That would require a significant re-write which would take much more time
than I have...
2000-07-05 22:50:59 +00:00
matt fcd0fb118f Make gcc 2.96 (and maybe earlier) happier. Include <stdlib.h>,<string.>,
etc. as appropriate to get exit,srncmp,abs,abort,etc.
Add -I${.CURDIR} to a few Makefiles
2000-07-03 02:51:12 +00:00
cgd d220ca5ba3 fix up NetBSD RCS Ids to match the standard, and the leading comment as
to match as well.  No functional changes.
2000-06-14 06:48:47 +00:00
simonb 659b78955d Don't need local extern declaration of strtouq() - it's in <stdlib.h>. 2000-05-10 05:09:17 +00:00
bjh21 6c97e2bd78 Initial commit of arm26 port 2000-05-09 21:55:44 +00:00
bad dc38443eae Catch up with changing size_t to ulong on sparc 10 months ago. 2000-04-09 01:08:17 +00:00
soren 89c5a767f8 Fix doubled 'the's. 2000-03-13 22:55:05 +00:00
itojun bb41dd1eaa add "#ifdef __sh3__" section.
(part of NetBSD/sh3 patches)
1999-09-12 16:10:45 +00:00
lukem dcab0210a0 convert from NOxxx= to MKxxx=no.
include <bsd.own.mk> if testing a MKxxx variable.
1999-02-13 02:54:17 +00:00
christos 487c013c51 char -> unsigned char 1998-12-20 19:05:19 +00:00
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
itohy a42010baf2 Eliminate memory leaks at case labels. 1998-10-10 20:51:48 +00:00
wsanchez 9e44eb8cc1 Add __ppc__ test 1998-10-08 01:30:50 +00:00
mycroft a65a57d7b3 Propagate the value and test contexts to the right-hand side of a
comma operator.
1998-07-28 03:39:29 +00:00
mycroft 11177fb359 Search both sides of a comma operator for side effects. 1998-07-27 19:58:43 +00:00
mycroft defaa2bc6e Fix a recurring typo: comparision -> comparison. 1998-07-27 13:50:46 +00:00
mycroft eb86b91807 Fix uses of uninitialized memory, and incorrect types for initializers.
From ITOH Yasufumi, PR 5861.
1998-07-27 12:10:22 +00:00
tv 482063559a .y.c <sys.mk> rule fixes. Don't create a y.tab.h file unless asked for,
and use smarter creation of the header file.
1998-04-09 00:32:31 +00:00
tv c3932dd723 Fix __RCSID() macro 1998-04-07 19:27:24 +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
lukem 8ba07ab0b3 use CPPFLAGS instead of CFLAGS 1997-10-24 09:00:17 +00:00
mycroft 70f7fd1f59 Hack to work around compiler bug for now. 1997-05-09 18:07:23 +00:00
thorpej 6833a50866 Add support for the PowerPC. 1997-04-19 06:16:29 +00:00
mycroft fd38f3efbc Remove hack for (very old) GCC bug on i386. 1997-03-12 18:28:55 +00:00
pk 25b5f4149a Splice a union in the type data structure. Some of the members can be `in use'
simultaneously, e.g. an enumerated bit-field.
1996-12-27 20:46:23 +00:00
cgd 06fa442b12 * recognize that pointers to identical unnamed and untyped structs,
unions, and enums are, in fact, identical.  This is done by tagging
  each of unnamed and untyped structure, union and enum with a unique
  position of creation, which is used as a unique identifier that
  when determine whether or not a pair of structures, unions, or enums
  are identical.

* accept the file name '-' to indicate that standard input is to be
  used as lint1 input.  That involves having lint pass the '-' through
  to the cpp which preprocesses the lint1 input, and having lint1's
  scanner recognize a cpp filename "" as "{standard input}".
1996-12-22 11:31:24 +00:00
cgd 0cde55a411 * recognize that pointers to identical unnamed and untyped structs,
unions, and enums are, in fact, identical.  This is done by tagging
  each of unnamed and untyped structure, union and enum with a unique
  position of creation, which is used as a unique identifier that
  when determine whether or not a pair of structures, unions, or enums
  are identical.
1996-12-22 11:31:05 +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
mark dad2775914 Define PTRDIFF_IS_LONG and SIZEOF_IS_ULONG for the arm32 port. 1996-04-01 21:47:57 +00:00
jonathan 9b69a8f7e5 Add PTRDIFF_IS_LONG and SIZEOF_IS_ULONG config entries for (32-bit) mips. 1995-12-17 02:53:11 +00:00
jpo 6df3d70406 use MB_LEN_MAX instead of MB_CUR_MAX for array declaration, because
MB_CUR_MAX may be a non-constant expression
1995-10-23 13:38:51 +00:00
jpo c31bb6f41c insert a conversion operator from argument type to parameter type also
if the subtypes of both argument and parameter do not match (use
eqtype() instead of comparing t_tspec fields only).
1995-10-02 17:37:57 +00:00
jpo 0c1422d6bc removed some dubious warnings about conversion of constant operands of
bitwise operators
1995-10-02 17:37:00 +00:00
jpo e284b17305 allow register variables as left operand of POINT; fixes PR 1442 1995-10-02 17:35:57 +00:00
jpo e5ba5db05b don't print a warning about use of unitialized variables if one of the
enclosing compound statements had already an asm statement
1995-10-02 17:35:11 +00:00
jpo 9f9008af93 no need to print a warning about inline keywords
"inline" is a valid keyword only with -g, and "__inline" is always
a valid keyword
1995-10-02 17:34:16 +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 bcb6c46ca1 some minor bug fixes 1995-10-02 17:22:46 +00:00