summaryrefslogtreecommitdiff
path: root/usr.bin/xlint
AgeCommit message (Collapse)Author
2006-01-16minimal recognition of C99 float hex constants, allows lint to parseMarc Espie
frexp.c. okay cloder@, millert@
2006-01-16Kill spurious warnings when using size_t as an index; since size_t andOtto Moerbeek
ptrdiff_T are now alays (u)long, tell lint that. ok millert@ deraadt@
2005-12-18Grok NORETURN function prototypes in addition to NORETURN functionChad Loder
definitions.
2005-12-17Handle __dead functions using lint comments.Chad Loder
2005-12-17Check for functions declared with ARGSUSED but having no arguments.Chad Loder
2005-12-16Make div by zero a non-fatal messageChad Loder
2005-12-16Limp along with integral 0 instead of UQUAD_MAX when there is a divisionChad Loder
by zero. This avoids bogus integer overflow errors in div by zero situations.
2005-12-16Call checkdbz with the correct operand, so that div by zero checks actuallyChad Loder
work, instead of resulting in an exception. Problem noticed by aaron.
2005-12-15Add a new warning message: conversion of %s return value from '%s' to '%s'.Chad Loder
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.
2005-12-14Move arg # to start of message. Makes it slighly more usefulKjell Wooding
even when display is truncated due to long file name. ok cloder
2005-12-12Restructure conditional from last checkin regarding constant in conditionalChad Loder
contexts, so that we do not lose the ability to warn on non-integer constants.
2005-12-12Cut down on extraneous "constant in conditional context" warnings whenChad Loder
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.
2005-12-11SRCS should contain .y and .l references, then make will do the right thingTheo de Raadt
2005-12-11make this compile againTheo de Raadt
2005-12-10Make the style of these messages more like that of gcc messages.Chad Loder
2005-12-10Change warning/error format to match gcc's.Chad Loder
2005-12-10how did this slip in, grr.Martin Reindl
2005-12-10translate a bunch of comments from german to englishMartin Reindl
ok cloder@
2005-12-10Lint now warns about sizeof(term) where the operator is anything otherChad Loder
than unary *, ->, a name, or a string.
2005-12-10Fix a commentChad Loder
2005-12-10Add a new lint flag '-f' which, for each warning or error, prints theChad Loder
offending line from the corresponding source code file. The general idea is OK deraadt
2005-12-10Back out all gcc attribute parsing changes until we can do this the rightChad Loder
way some day. The effect of __attribute__ on a LALR C grammar is just too ugly to fix quicklly.
2005-12-10Fix a crash when enum bitfields are encountered. Reported by marc onChad Loder
sparc but we really should see the crash on any arch. Lots of places in the code assume that if tspec == ENUM that they can touch t_enum, so when we see an ENUM bitfield, we coerce the type to INT or UINT. We also clear the t_isenum flag and the t_proto flag any time we invalidate the data in the union. We should be stricter about checking t_isenum everywhere, but that is a bigger job.
2005-12-09Do not warn about assignment in conditional context if the assignmentChad Loder
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
2005-12-09Another case theo reminded me ofChad Loder
2005-12-09Don't ever complain when assigning a char literal to a char lvalue,Chad Loder
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.
2005-12-07Remove extra printfsChad Loder
2005-12-07Refactor __attribute__ parsing a bit. This takes us further to being ableChad Loder
to not only consume, but also make sense of gcc __attribute__ syntax.
2005-12-06back out -CC change. It breaks lint on most of our architecturesTheo de Raadt
because -CC is something that showed up in a later gcc. This is what happens when a pair of developers do not test on all our architectures.
2005-12-03Fix enum types, thanks lintChad Loder
2005-12-03Lint can now parse every variation of gcc's __attribute__ that I could findChad Loder
either in our tree or in the gcc docs. See regression test 11 for examples of this. Right now, our cdefs.h actually defines __attribute__(x) to blank when lint runs. We can change this whenever we choose.
2005-12-02Add a -y option, undocumented for now, that tells lint to pass -y to lint1.Chad Loder
The -y option tells lint1 to output yacc debug information (if it was compiled with YYDEBUG=1).
2005-12-02Make three of the keytab fields into a union, because they are 3 differentChad Loder
enums that are mutually exclusive with each other. Makes this file so much neater.
2005-12-02make lint invoke cpp with -CC instead of -C, which will cause commentsAlexander von Gernler
in #define macros to be preserved. This makes way for addition of lint statements to a lot of .h files. ok cloder@
2005-12-01Make lint quieter by only warning on "foo declared but never used orChad Loder
defined" when foo is declared in the translation unit that lint is working on. This means that symbols that are declared in an included header file don't get this warning, ever.
2005-12-01TypoChad Loder
2005-11-30Add support for // comments. From NetBSDChad Loder
2005-11-30spacingTheo de Raadt
2005-11-30KNFChad Loder
2005-11-30KNFChad Loder
2005-11-30Fix a very old bug_t with memsetChad Loder
2005-11-29stdlib.h has strtouq in itChad Loder
2005-11-29TypoChad Loder
2005-11-29TypoChad Loder
2005-11-29Replace unnecessary mmap allocator with malloc.Chad Loder
2005-11-29Remove old gcc 2.9.5 workaround for sparc64 now that we use gcc3.Chad Loder
Tested sturm@
2005-11-29Remove XXX_BROKEN_GCC ifdefs, which were used to work around an ancientChad Loder
(from 1995) gcc bug on i386. From NetBSD.
2005-11-29Typos in comments: explizit and implizitChad Loder
2005-11-29Kill unused localsChad Loder
2005-11-29Make lint grok __func__, which in C99 is a predifined identifier thatChad Loder
holds the name of the current function. Makes thousands of lint warnings vanish and since lint can now fully parse compound expressions involving __func__, we see some new interesting warnings instead.