Powered by Linux
new sval patches — Semantic Matching Tool

new sval patches

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I've just pushed sort of a big set of patches.  If you have custom
Smatch scripts they will probably need to be modified.

It also changes the output format slightly.
	1) Negative numbers always have parenthesis around them.
	2) "min" and "max" are now "u32max" or "s64min".
	3) The check_signed.c check was re-written.

Here is the commit message:
--------------------------------------------------

Before smatch used "long long" to represent values.  This fails
because it isn't possible to represent ULLONG_MAX.  The sval
work solves that by always connecting the value to the type.

Instead of "long long" we now use an sval_t which is defined like
this:

typedef struct {
	struct symbol *type;
	union {
		long long value;
		unsigned long long uvalue;
	};
} sval_t;

The sval_t type has been pushed everywhere now so we always have
easy access to a struct symbol *type.

That bad news is that a lot of error messages will change formats
slightly.  In particular check_signed.c has been re-written.

--------------------------------------------------

In the old way if you wanted you could say:
	long long val = 1;
but now you need to specify the type as well:
	sval_t val = sval_type_val(&int_ctype, 1);

If you want to add two values together then you would do:
	res = sval_binop(one, '+', two);

Anway, give it a test.  Let me know if you spot any bugs.

regards,
dan carpenter
--
To unsubscribe from this list: send the line "unsubscribe smatch" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux