Age | Commit message (Collapse) | Author |
|
|
|
|
|
by zero. This avoids bogus integer overflow errors in div by zero
situations.
|
|
work, instead of resulting in an exception. Problem noticed by aaron.
|
|
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.
|
|
even when display is truncated due to long file name.
ok cloder
|
|
contexts, so that we do not lose the ability to warn on non-integer
constants.
|
|
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.
|
|
|
|
|
|
|
|
|
|
|
|
ok cloder@
|
|
than unary *, ->, a name, or a string.
|
|
|
|
offending line from the corresponding source code file. The general
idea is OK deraadt
|
|
way some day. The effect of __attribute__ on a LALR C grammar is just too
ugly to fix quicklly.
|
|
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.
|
|
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
|
|
|
|
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.
|
|
|
|
to not only consume, but also make sense of gcc __attribute__ syntax.
|
|
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.
|
|
|
|
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.
|
|
The -y option tells lint1 to output yacc debug information (if it was
compiled with YYDEBUG=1).
|
|
enums that are mutually exclusive with each other. Makes this file so
much neater.
|
|
in #define macros to be preserved. This makes way for addition of lint
statements to a lot of .h files.
ok cloder@
|
|
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Tested sturm@
|
|
(from 1995) gcc bug on i386. From NetBSD.
|
|
|
|
|
|
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.
|
|
|
|
|
|
|
|
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.
|