Up to [local] / src / usr.bin / xlint / lint1
Request diff between arbitrary revisions
Default branch: MAIN
Revision 1.49, Sun Apr 8 16:27:00 2012 UTC (12 years, 2 months ago) by jsg
Branch: MAIN
CVS Tags: HEAD
Changes since 1.48: +1 -1 lines
FILE REMOVED
tedu lint ok tedu@ guenther@ krw@ espie@ deraadt@
Revision 1.48 / (download) - annotate - [select for diffs], Wed Sep 21 18:08:07 2011 UTC (12 years, 8 months ago) by jsg
Branch: MAIN
CVS Tags: OPENBSD_5_1_BASE,
OPENBSD_5_1
Changes since 1.47: +1 -5 lines
Diff to previous 1.47 (colored)
remove rcsids which escaped the purge of 2009
Revision 1.47 / (download) - annotate - [select for diffs], Sat Jul 24 22:17:03 2010 UTC (13 years, 10 months ago) by guenther
Branch: MAIN
CVS Tags: OPENBSD_5_0_BASE,
OPENBSD_5_0,
OPENBSD_4_9_BASE,
OPENBSD_4_9,
OPENBSD_4_8_BASE,
OPENBSD_4_8
Changes since 1.46: +63 -6 lines
Diff to previous 1.46 (colored)
Teach lint about C99's _Bool and _Complex, plus some related gcc extensions: __real__ and __imag__ operators, the use of '~' for complex conjugation, and 'i' or 'j' as a suffix for complex constants. While this doesn't handle folding and overflow detection for complex constants correctly, it's good enough to make it through libm...and found several bugs once it could do so. "no objections" miod@, krw@
Revision 1.46 / (download) - annotate - [select for diffs], Wed Oct 17 20:10:44 2007 UTC (16 years, 7 months ago) by chl
Branch: MAIN
CVS Tags: OPENBSD_4_7_BASE,
OPENBSD_4_7,
OPENBSD_4_6_BASE,
OPENBSD_4_6,
OPENBSD_4_5_BASE,
OPENBSD_4_5,
OPENBSD_4_4_BASE,
OPENBSD_4_4,
OPENBSD_4_3_BASE,
OPENBSD_4_3
Changes since 1.45: +3 -4 lines
Diff to previous 1.45 (colored)
remove "unused variable" warnings tested by deraadt@ on a gcc2 arch looks ok ray@ ok deraadt@
Revision 1.45 / (download) - annotate - [select for diffs], Sat Sep 8 17:49:19 2007 UTC (16 years, 9 months ago) by cloder
Branch: MAIN
Changes since 1.44: +6 -5 lines
Diff to previous 1.44 (colored)
Fix false negatives in dealing with unreachable code after calls to __dead functions. Prodded by fgs@, but a different diff than his. "Makes sense" fgs@
Revision 1.44 / (download) - annotate - [select for diffs], Thu Oct 26 22:36:54 2006 UTC (17 years, 7 months ago) by cloder
Branch: MAIN
CVS Tags: OPENBSD_4_2_BASE,
OPENBSD_4_2,
OPENBSD_4_1_BASE,
OPENBSD_4_1
Changes since 1.43: +3 -4 lines
Diff to previous 1.43 (colored)
Remove an unused variable spotted by lint.
Revision 1.43 / (download) - annotate - [select for diffs], Fri Jun 2 17:38:59 2006 UTC (18 years ago) by cloder
Branch: MAIN
CVS Tags: OPENBSD_4_0_BASE,
OPENBSD_4_0
Changes since 1.42: +63 -42 lines
Diff to previous 1.42 (colored)
Rework logic for function argument conversion warnings. Only do certain classes of warnings if the function is not actually governed by a prototype, otherwise in standard C the compiler is free to avoid the usual widening/renarrowing conversions familiar to us from traditional C. This gets rid of many duplicate warnings. There is still more work to do to quiet lint but this is a necessary prerequisite.
Revision 1.42 / (download) - annotate - [select for diffs], Mon May 29 20:47:22 2006 UTC (18 years ago) by cloder
Branch: MAIN
Changes since 1.41: +70 -132 lines
Diff to previous 1.41 (colored)
Get rid of -t (traditional C) option. Some corrections by moritz.
Revision 1.41 / (download) - annotate - [select for diffs], Sun May 28 23:42:49 2006 UTC (18 years ago) by cloder
Branch: MAIN
Changes since 1.40: +3 -3 lines
Diff to previous 1.40 (colored)
Kill the -a option for lint, which controlled (inconsistently) warnings regarding narrowing conversions. For now, lint still accepts and ignores the -a option, but soon I will remove it utterly and change the default LINTFLAGS.
Revision 1.40 / (download) - annotate - [select for diffs], Fri May 5 20:00:35 2006 UTC (18 years, 1 month ago) by otto
Branch: MAIN
Changes since 1.39: +3 -3 lines
Diff to previous 1.39 (colored)
Do not warn when casting a pointer to [unsigned] char *; discussion with espie@; ok cloder@
Revision 1.39 / (download) - annotate - [select for diffs], Wed May 3 18:22:41 2006 UTC (18 years, 1 month ago) by otto
Branch: MAIN
Changes since 1.38: +46 -35 lines
Diff to previous 1.38 (colored)
be smarter about warning for null effects; kills a lot of spurious warnings. ok cloder@
Revision 1.38 / (download) - annotate - [select for diffs], Thu Apr 27 20:46:44 2006 UTC (18 years, 1 month ago) by otto
Branch: MAIN
Changes since 1.37: +3 -3 lines
Diff to previous 1.37 (colored)
print a quad as %lld, not %d
Revision 1.37 / (download) - annotate - [select for diffs], Thu Apr 27 20:37:33 2006 UTC (18 years, 1 month ago) by otto
Branch: MAIN
Changes since 1.36: +5 -5 lines
Diff to previous 1.36 (colored)
Correctly process comma operator when hunting for "expression has null effect" warnings. NetBSD has same fix, I found out after the fact. ok cloder@
Revision 1.36 / (download) - annotate - [select for diffs], Tue Apr 25 01:25:41 2006 UTC (18 years, 1 month ago) by cloder
Branch: MAIN
Changes since 1.35: +18 -14 lines
Diff to previous 1.35 (colored)
Rather than use the psize() macro everywhere (portable size macro which only makes sense when -p option is specified to lint), add a new concept and macro called rank(), which corresponds to the C99 definition of rank for integral types. This has one main benefit, which is that on ILP32 platforms, if -p was not specified, lint did not warn when the code converted from long to int, because they are the same size. This is fixed. While here, get rid of a false positive with warning 259, when converting from an unsigned char to an int, for example.
Revision 1.35 / (download) - annotate - [select for diffs], Tue Apr 18 04:10:05 2006 UTC (18 years, 1 month ago) by cloder
Branch: MAIN
Changes since 1.34: +8 -6 lines
Diff to previous 1.34 (colored)
For prototype argument conversions, include both "from" and "to" types.
Revision 1.34 / (download) - annotate - [select for diffs], Tue Apr 18 03:59:46 2006 UTC (18 years, 1 month ago) by cloder
Branch: MAIN
Changes since 1.33: +45 -38 lines
Diff to previous 1.33 (colored)
For all warnings involving prototypes, print the function name and the argument number.
Revision 1.33 / (download) - annotate - [select for diffs], Tue Apr 18 03:10:27 2006 UTC (18 years, 1 month ago) by cloder
Branch: MAIN
Changes since 1.32: +22 -3 lines
Diff to previous 1.32 (colored)
Add a funcname() function, which returns the name of a function given a CALL or AMPER or NAME node to a function or pointer to a function. This will come in handy later.
Revision 1.32 / (download) - annotate - [select for diffs], Tue Apr 18 02:59:40 2006 UTC (18 years, 1 month ago) by cloder
Branch: MAIN
Changes since 1.31: +66 -48 lines
Diff to previous 1.31 (colored)
The old way of passing function argument information was to pass an int which corresponded to the argument # (1-based, with 0 meaning it is not an argument). This sucked because it is impossible to include the function name or argument name in warnings when all you have is an argument number. Introduce a new type farg_t which represents a passed function argument. struct farg contains argument number, function name, and argument symbol information from the prototype).
Revision 1.31 / (download) - annotate - [select for diffs], Mon Mar 20 05:05:30 2006 UTC (18 years, 2 months ago) by cloder
Branch: MAIN
Changes since 1.30: +3 -3 lines
Diff to previous 1.30 (colored)
Lint should not complain about expressions of the form: ((x == y) == z) because this is perfectly legal in C. deraadt@ was seeing lint false positives with the S_ISREG macro from stat.h. So set m_eqwarn to 0 for the EQ operator. See xlint regress case #16.
Revision 1.30 / (download) - annotate - [select for diffs], Sat Dec 17 21:08:27 2005 UTC (18 years, 5 months ago) by cloder
Branch: MAIN
CVS Tags: OPENBSD_3_9_BASE,
OPENBSD_3_9
Changes since 1.29: +5 -2 lines
Diff to previous 1.29 (colored)
Handle __dead functions using lint comments.
Revision 1.29 / (download) - annotate - [select for diffs], Fri Dec 16 03:01:35 2005 UTC (18 years, 5 months ago) by cloder
Branch: MAIN
Changes since 1.28: +4 -4 lines
Diff to previous 1.28 (colored)
Make div by zero a non-fatal message
Revision 1.28 / (download) - annotate - [select for diffs], Fri Dec 16 02:56:53 2005 UTC (18 years, 5 months ago) by cloder
Branch: MAIN
Changes since 1.27: +3 -3 lines
Diff to previous 1.27 (colored)
Limp along with integral 0 instead of UQUAD_MAX when there is a division by zero. This avoids bogus integer overflow errors in div by zero situations.
Revision 1.27 / (download) - annotate - [select for diffs], Fri Dec 16 02:12:30 2005 UTC (18 years, 5 months ago) by cloder
Branch: MAIN
Changes since 1.26: +5 -5 lines
Diff to previous 1.26 (colored)
Call checkdbz with the correct operand, so that div by zero checks actually work, instead of resulting in an exception. Problem noticed by aaron.
Revision 1.26 / (download) - annotate - [select for diffs], Thu Dec 15 05:49:49 2005 UTC (18 years, 6 months ago) by cloder
Branch: MAIN
Changes since 1.25: +11 -2 lines
Diff to previous 1.25 (colored)
Add a new warning message: conversion of %s return value from '%s' to '%s'. Lint now warns when a function's return value is converted to a smaller (or differently signed) type. These conversions can happen when doing an assignment, when passing a function's return value as an argument to another function, or when initializing a variable. Currently this produces useless warnings on tolower() and toupper() because they return ints but are usually assigned to chars.
Revision 1.25 / (download) - annotate - [select for diffs], Wed Dec 14 22:09:40 2005 UTC (18 years, 6 months ago) by kjell
Branch: MAIN
Changes since 1.24: +6 -6 lines
Diff to previous 1.24 (colored)
Move arg # to start of message. Makes it slighly more useful even when display is truncated due to long file name. ok cloder
Revision 1.24 / (download) - annotate - [select for diffs], Mon Dec 12 23:40:37 2005 UTC (18 years, 6 months ago) by cloder
Branch: MAIN
Changes since 1.23: +5 -5 lines
Diff to previous 1.23 (colored)
Restructure conditional from last checkin regarding constant in conditional contexts, so that we do not lose the ability to warn on non-integer constants.
Revision 1.23 / (download) - annotate - [select for diffs], Mon Dec 12 23:35:59 2005 UTC (18 years, 6 months ago) by cloder
Branch: MAIN
Changes since 1.22: +13 -8 lines
Diff to previous 1.22 (colored)
Cut down on extraneous "constant in conditional context" warnings when lint encounters expressions like do { ... } while (0); and if (1) ... We use these idioms frequently in our tree for scoping purposes and we deem them to be safe. Now lint will not warn if it encounters a constant in a conditional context when the expression consists only of a constant (with no operators) and the constant is 0 or 1. This means that lint will not warn for "if (1)" but will warn for "if (2)" and will also continue to warn for "if (foo && 1)". This cuts down the vast majority of these warnings while still preserving the ability to catch bugs.
Revision 1.22 / (download) - annotate - [select for diffs], Sat Dec 10 18:42:45 2005 UTC (18 years, 6 months ago) by cloder
Branch: MAIN
Changes since 1.21: +22 -2 lines
Diff to previous 1.21 (colored)
Lint now warns about sizeof(term) where the operator is anything other than unary *, ->, a name, or a string.
Revision 1.21 / (download) - annotate - [select for diffs], Fri Dec 9 04:28:28 2005 UTC (18 years, 6 months ago) by cloder
Branch: MAIN
Changes since 1.20: +3 -3 lines
Diff to previous 1.20 (colored)
Do not warn about assignment in conditional context if the assignment expression is itself wrapped in parentheses. We use this idiom in our tree to indicate that the programmer knows and accepts that an assignment is happening. Idea suggested by deraadt
Revision 1.20 / (download) - annotate - [select for diffs], Fri Dec 9 03:33:11 2005 UTC (18 years, 6 months ago) by cloder
Branch: MAIN
Changes since 1.19: +11 -4 lines
Diff to previous 1.19 (colored)
Another case theo reminded me of
Revision 1.19 / (download) - annotate - [select for diffs], Fri Dec 9 03:13:08 2005 UTC (18 years, 6 months ago) by cloder
Branch: MAIN
Changes since 1.18: +19 -4 lines
Diff to previous 1.18 (colored)
Don't ever complain when assigning a char literal to a char lvalue, regardless of sign/unsign differences. In other words, even though C treats char literals as ints, if the rvalue is a literal inside single quotes, and the lvalue is any kind of char, then assume the programmer knows what he is doing.
Revision 1.18 / (download) - annotate - [select for diffs], Tue Nov 29 19:50:33 2005 UTC (18 years, 6 months ago) by cloder
Branch: MAIN
Changes since 1.17: +2 -36 lines
Diff to previous 1.17 (colored)
Remove XXX_BROKEN_GCC ifdefs, which were used to work around an ancient (from 1995) gcc bug on i386. From NetBSD.
Revision 1.17 / (download) - annotate - [select for diffs], Tue Nov 29 03:42:32 2005 UTC (18 years, 6 months ago) by cloder
Branch: MAIN
Changes since 1.16: +2 -5 lines
Diff to previous 1.16 (colored)
Kill unused locals
Revision 1.16 / (download) - annotate - [select for diffs], Mon Nov 28 22:29:57 2005 UTC (18 years, 6 months ago) by cloder
Branch: MAIN
Changes since 1.15: +52 -11 lines
Diff to previous 1.15 (colored)
Simplify checks for division by zero.
Revision 1.15 / (download) - annotate - [select for diffs], Mon Nov 28 04:57:26 2005 UTC (18 years, 6 months ago) by cloder
Branch: MAIN
Changes since 1.14: +3 -3 lines
Diff to previous 1.14 (colored)
Another comment typo
Revision 1.14 / (download) - annotate - [select for diffs], Mon Nov 28 04:57:04 2005 UTC (18 years, 6 months ago) by cloder
Branch: MAIN
Changes since 1.13: +26 -26 lines
Diff to previous 1.13 (colored)
Typos in comments
Revision 1.13 / (download) - annotate - [select for diffs], Mon Nov 28 03:12:52 2005 UTC (18 years, 6 months ago) by cloder
Branch: MAIN
Changes since 1.12: +3 -3 lines
Diff to previous 1.12 (colored)
Set m_balance to 0 for the COLON operator, thus avoiding a false positive. In the "question mark" construct, there is no balancing or conversions between the LHS and RHS of the colon; thus, there is no need for the LHS and RHS of the colon to be of compatible types (as long as the LHS and RHS are each compatible with the lvalue of the expression having the question mark expression as the rvalue. Currently lint doesn't verify that.
Revision 1.12 / (download) - annotate - [select for diffs], Mon Nov 28 01:04:18 2005 UTC (18 years, 6 months ago) by cloder
Branch: MAIN
Changes since 1.11: +10 -5 lines
Diff to previous 1.11 (colored)
Do not complain about promotion of a constant (e.g. from int literal to a quad argument) as long as the constant is within the range of the type being promoted to.
Revision 1.11 / (download) - annotate - [select for diffs], Wed Nov 23 00:12:13 2005 UTC (18 years, 6 months ago) by cloder
Branch: MAIN
Changes since 1.10: +15 -5 lines
Diff to previous 1.10 (colored)
Warn on a right shift of an N-bit quantity by >= N bits. OK millert, deraadt
Revision 1.10 / (download) - annotate - [select for diffs], Mon Nov 21 18:28:24 2005 UTC (18 years, 6 months ago) by cloder
Branch: MAIN
Changes since 1.9: +5 -5 lines
Diff to previous 1.9 (colored)
Print both "from" and "to" types in type conversion warnings. Idea from NetBSD. OK deraadt, millert
Revision 1.9 / (download) - annotate - [select for diffs], Sun Nov 20 17:42:49 2005 UTC (18 years, 6 months ago) by deraadt
Branch: MAIN
Changes since 1.8: +11 -11 lines
Diff to previous 1.8 (colored)
spacing
Revision 1.8 / (download) - annotate - [select for diffs], Sat Nov 19 03:35:27 2005 UTC (18 years, 6 months ago) by cloder
Branch: MAIN
Changes since 1.7: +70 -181 lines
Diff to previous 1.7 (colored)
knf. OK kjell, brad
Revision 1.7 / (download) - annotate - [select for diffs], Mon Jan 24 00:12:28 2005 UTC (19 years, 4 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_3_8_BASE,
OPENBSD_3_8,
OPENBSD_3_7_BASE,
OPENBSD_3_7
Changes since 1.6: +3 -2 lines
Diff to previous 1.6 (colored)
Update length field in catstrg() with the length of the appended string. Based on a diff from Claus Assmann. Closes PR 4073.
Revision 1.6 / (download) - annotate - [select for diffs], Sat Feb 16 21:27:59 2002 UTC (22 years, 3 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_3_6_BASE,
OPENBSD_3_6,
OPENBSD_3_5_BASE,
OPENBSD_3_5,
OPENBSD_3_4_BASE,
OPENBSD_3_4,
OPENBSD_3_3_BASE,
OPENBSD_3_3,
OPENBSD_3_2_BASE,
OPENBSD_3_2,
OPENBSD_3_1_BASE,
OPENBSD_3_1
Changes since 1.5: +36 -36 lines
Diff to previous 1.5 (colored)
Part one of userland __P removal. Done with a simple regexp with some minor hand editing to make comments line up correctly. Another pass is forthcoming that handles the cases that could not be done automatically.
Revision 1.5 / (download) - annotate - [select for diffs], Wed Sep 19 10:58:07 2001 UTC (22 years, 8 months ago) by mpech
Branch: MAIN
CVS Tags: OPENBSD_3_0_BASE,
OPENBSD_3_0
Changes since 1.4: +3 -3 lines
Diff to previous 1.4 (colored)
occured->occurred idea from deraadt@ via NetBSD millert@ ok p.s. Next commit will fix a typo in the sys/
Revision 1.4 / (download) - annotate - [select for diffs], Wed Jul 29 03:14:50 1998 UTC (25 years, 10 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_2_9_BASE,
OPENBSD_2_9,
OPENBSD_2_8_BASE,
OPENBSD_2_8,
OPENBSD_2_7_BASE,
OPENBSD_2_7,
OPENBSD_2_6_BASE,
OPENBSD_2_6,
OPENBSD_2_5_BASE,
OPENBSD_2_5,
OPENBSD_2_4_BASE,
OPENBSD_2_4
Changes since 1.3: +8 -7 lines
Diff to previous 1.3 (colored)
fix some initialization; ITOH Yasufumi <yasufu-i@is.aist-nara.ac.jp>
Revision 1.3 / (download) - annotate - [select for diffs], Mon Jul 27 16:53:41 1998 UTC (25 years, 10 months ago) by deraadt
Branch: MAIN
Changes since 1.2: +13 -13 lines
Diff to previous 1.2 (colored)
s/comparision/comparison/g; netbsd
Revision 1.2 / (download) - annotate - [select for diffs], Wed Jun 26 05:44:19 1996 UTC (27 years, 11 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_2_3_BASE,
OPENBSD_2_3,
OPENBSD_2_2_BASE,
OPENBSD_2_2,
OPENBSD_2_1_BASE,
OPENBSD_2_1,
OPENBSD_2_0_BASE,
OPENBSD_2_0
Changes since 1.1: +2 -1 lines
Diff to previous 1.1 (colored)
rcsid
Revision 1.1.1.1 / (download) - annotate - [select for diffs] (vendor branch), Wed Oct 18 08:47:03 1995 UTC (28 years, 8 months ago) by deraadt
CVS Tags: netbsd_1_1
Changes since 1.1: +0 -0 lines
Diff to previous 1.1 (colored)
initial import of NetBSD tree
Revision 1.1 / (download) - annotate - [select for diffs], Wed Oct 18 08:47:03 1995 UTC (28 years, 8 months ago) by deraadt
Branch: MAIN
Initial revision