Age | Commit message (Collapse) | Author |
|
|
|
effect" warnings. NetBSD has same fix, I found out after the fact.
ok cloder@
|
|
|
|
|
|
|
|
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.
|
|
|
|
expansios). On gcc 2.95, we can't do this yet because the preprocessor
support for -CC is not fully functional yet. OK deraadt@
|
|
This defect was introduced by me on my last commit and found by dlg@
when linting in kernel.
|
|
as used so that lint2 doesn't complain. Prodded by deraadt
|
|
this is necessitated by output of lex (thanks a lot).
|
|
|
|
|
|
|
|
argument number.
|
|
CALL or AMPER or NAME node to a function or pointer to a function. This
will come in handy later.
|
|
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).
|
|
code detection and later on, other things.
|
|
okay millert@
|
|
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.
|
|
but having no arguments. ok deraadt@ cloder@
|
|
o typos in comments
o missing #include
o remove pointless nomem() func
o unused variables
o more use of asprintf(3)
ok deraadt@
|
|
Successful build with i386 and sparc64.
|
|
frexp.c.
okay cloder@, millert@
|
|
ptrdiff_T are now alays (u)long, tell lint that. ok millert@ deraadt@
|
|
definitions.
|
|
|
|
|
|
|
|
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.
|
|
|