| Age | Commit message (Collapse) | Author | Files | Lines |
|
up for various system deficiencies.
This makes sparse easier to port to silly things like
MinGW or Solaris. In particular:
- strtold() is a C99 thing, not everybody has it
- MinGW has problems with mmap(MAP_ANONYMOUS) and doesn't zero it.
- st_ino/st_dev is POSIX identity testing, not supported by MinGW
|
|
warn->warning
error->error_die
new error
lib.h:
warn->warning
error->error_die
new error
Add gcc format checking to warning/error/...
|
|
Associate them with each computed goto, and copy them properly
when inlining.
|
|
Also fix the type return of initializer evaluation, so that we
get the right size in the right place.
Add the necessary lines to parse the thing too.
|
|
FP handling added, everything straightforward by now.
|
|
Also, while we're here, be more careful about the
exact limits, and concatenation: we want to have
the ending NUL character even when we concatenate
too much.
|
|
|
|
This teaches sparse what __alignof__ really means, instead of just using
the same code as "__sizeof__"
It gets rid of the warnings in ebtables that does:
struct ebt_entries {
...
char data[0] __attribute__ ((aligned (__alignof__(struct ebt_replace)));
};
Which caused warning because sparse was evaluating __alignof__ as the same as sizeof,
and sizeof was 57 (ie non-power of 2).
This is just based on the existing code and a peek at the data
structures in expression and symbol.
|
|
This updates the type semantics of "get_number_value()" to C99 semantics
rather than the previous gcc/C90 type expansion semantics.
Now regular decimal integers (without suffixes) that are too big to fit
in "long" expand to "long long" rather than "unsigned long".
It also uses "strtoull()" rather than open-coding the conversion.
|
|
unsigned stays as an (unsigned) int. Otherwise it becomes
a long.
|
|
This function was the top performance offender in sparse.
We really want it inlined, since all it really does is
to do an indirect call or two, and if inlined that call
turns into a direct call.
Making it a macro allows us to pass in the operation
comparison as code rather than as a list of integers,
which again allows the compiler to do a much better
job.
|
|
following unary expressions.
|
|
Thus 0x1234_5678 is a valid constant, as is 100_000_ul.
The parser doesn't care where they are.
|
|
just TOKEN_NUMBER.
This matches how tokenization is supposed to be done, and simplifies
the code.
Expression evaluation changed to cope with the new rules.
|
|
We'd incorrectly test the right type of a compatible
pointer expression for "void *" without dropping off
the node information.
This allows us to fix a casting bug, where we used
to drop the node information at the cast.
|
|
So let's make that explicit in the parse tree, and avoid
carrying the special cases around further. This makes the
evaluation phase only have one case to worry about.
|
|
This makes it a lot easier to see what's up.
|
|
rename them lower cased to match standard C naming rules.
|
|
We now require square brackets around the type, to avoid
any confusion with casts or variable declarations:
if ([typeof(x)] == [int])
...
|
|
comparisons etc:
if (typeof(a) == int) {
...
(although right now I don't actually do the proper comparison
expansion and all comparisons return "true").
|
|
I think I'll allow type expressions at some point, since
it shouldn't actually be all that hard, and would even clean
some stuff up. But for now, we'll just warn about non-C code.
|
|
This patch makes a cast expression followed by an initializer list into
a postfix expression that can be dereferenced as a structure or an array.
There are approximately 7 instances of these expressions in the Linux kernel,
that give warnings about "expected lvalue for member dereference".
The approach involved introducing a new "stack-based temporary" symbol
of the same type as the cast expression, and using this as the target
of the initialization expression. The subsequent array or structure
member dereferences are made to that temporary symbol.
show-parse.c need modification to display a symbol expression with
an initializer list that is NOT in a symbol declaration list.
An example of this form with structure member dereference is:
typedef struct { long t1; long t2; long t3; } longstruct_t;
long test;
int
main(void)
{
int a, b, c;
test = (longstruct_t){a, b, c}.t3;
return 0;
}
An example of this form with array member dereference is:
typedef int iarray[2];
int pgp;
main(void)
{
int index;
int a, b;
pgp = (iarray){a,b}[index];
}
|
|
isn't the sole copyright owner these days.
|
|
actually handle them correctly later on yet.
|
|
(&&label) and computed goto (goto *expr).
Add label ctype for __label__ identifier. This is still quite broken
(it should create a block-symbol in the NS_LABEL namespace, right now
it creates a regular symbol).
|
|
used for bitfields where we really don't care.
|
|
preparing for a public release.
|
|
if sizeof(long long) == sizeof(long) (and furter if it's
also the same size as 'int', all perfectly legal C). Fix
it by his suggestion.
|
|
Make the pre-processor use the expression evaluator, so that
it actually gets all the signed/unsigned comparisons right
etc.
Make logical expressions an expression type of their own.
They have some very special behaviour both type-wise and
evaluation-wise (the short-circuiting thing).
|
|
the real one when it goes out the door.
|
|
|
|
Now constant expressions (strings, integers and fp constants)
are evaluated at parse-time into the proper EXPR_xxx type.
Remove "struct token" from "struct statement", which really only
wanted to know the position. So replace it with "struct position".
|
|
- expand combinations ('a += b' => 'a = a + b')
- check resulting types
Rename 'MINUS' and 'TIMES' as 'SUB' and 'MUL' in assignments.
|
|
add them to the parse tree. We now do.
|
|
and evaluate their type to be arrays of char rather than just a pointer.
|
|
|
|
to it, instead of having everybody have pointers to "struct token"
only because they wanted to have the position.
Fix array addition type degeneration.
|
|
even though they parse like other binops: they have different semantic
type behaviour, and should be evaluated separately.
Show bitfield symbol types.
|
|
make the arguments use a proper argument list instead of being
a comma-expression (which has totally different type semantics).
Evaluate assignments and function calls (and their arguments).
Show function calls in the debug info.
|
|
handling of 'long' and 'long long' types. Fix cast parsing
and evaluate casts.
|
|
etc. Add a function call expression type. Make expression type
evaluation return a success/failure value.
|
|
its own - expression.c.
|