| Age | Commit message (Collapse) | Author | Files | Lines |
|
The size of wide chars was hardcoded to 32.
Fix this by using a variable to hold this 'bits_in_wchar',
like done for all others datatypes.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
|
|
When layout the array element, the element size should
round up to byte align.
Signed-off-by: Christopher Li <sparse@chrisli.org>
|
|
Currently, sparse handles arrays of bools incorrectly. If you declare an
array of bools like this:
static _Bool boolarray[3] = {
[0] = 1,
[1] = 1,
};
...you get warnings like this (which are bogus):
./test.c:2:10: warning: Initializer entry defined twice
./test.c:3:10: also defined here
The problem is that bits_to_bytes rounds down instead of up, and sparse
defaults to _Bool being only 1 bit in size. This causes sparse to think
that they sit within the same byte, when they do not.
Fix bits_to_bytes to round up instead of down, and fix the call in
init_ctype to no longer correct for it. Also add a validation
test to ensure that we don't break this in the future.
Signed-off-by: Jeff Layton <jlayton@primarydata.com>
Signed-off-by: Christopher Li <sparse@chrisli.org>
|
|
GCC provides a 128 bit type called internally as TImode (__int128_t)on 64 bit
platforms (at least x86_64 and Sparc64). These types are used by OpenBIOS.
Add support for types "long long long", __mode__(TI) and __(u)int128_t.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Signed-off-by: Christopher Li <sparse@chrisli.org>
|
|
Signed-off-by: David Given <dg@cowlark.com>
[negative value division fixed by alexey.zaytsev@gmal.com]
Signed-off-by: Alexey Zaytsev <alexey.zaytsev@gmail.com>
|
|
Right now it's a strange kind of single-bit integer. As
a result, you cannot do a "sizeof" on it. Dunno what the
real C99 semantics should be, and don't much care yet.
|
|
rename them lower cased to match standard C naming rules.
|
|
instead of hardcoding it at compile time. This allows
us to do "cross-checks" much more easily.
|
|
"The compiler automatically sets the alignment for the
declared variable or field to the largest alignment which
is ever used for any data type on the target machine you
are compiling for"
So add the proper define to "target.h" and make it so.
|
|
expressions.
|
|
users to match.
Examine array type sizes.
Evaluate 'sizeof()', and realize that you can dereference arrays
as well as pointers.
|
|
|
|
Add 'target.h' to describe size of target-dependent types.
Add parsing of size information to gather the size for simple
types, pointers and structures/unions.
|