aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/target.h
AgeCommit message (Collapse)AuthorFilesLines
2017-05-19fix hardcoded size of wide charsLuc Van Oostenryck1-0/+2
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>
2014-07-17round up the array element size to byte alignChristopher Li1-0/+8
When layout the array element, the element size should round up to byte align. Signed-off-by: Christopher Li <sparse@chrisli.org>
2014-07-16sparse: make bits_to_bytes round up instead of downJeff Layton1-1/+1
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>
2009-08-01Add support for TImode type (__int128_t)Blue Swirl1-0/+1
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>
2008-12-17Unhardcode byte size being 8 bits.David Given1-0/+14
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>
2005-04-07Implement a C99-like _Bool type.Linus Torvalds1-0/+1
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.
2005-04-07Now that BITS_IN_XXXX aren't defined contstants any more,Linus Torvalds1-15/+15
rename them lower cased to match standard C naming rules.
2005-04-07Use variables for target data structure information, Linus Torvalds1-17/+17
instead of hardcoding it at compile time. This allows us to do "cross-checks" much more easily.
2005-04-07Peter Jones informs about the gcc "attribute((aligned))" behaviour:Linus Torvalds1-0/+5
"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.
2005-04-07Evaluate (ptr - ptr). Do the sizeof scaling for (ptr + int)Linus Torvalds1-0/+1
expressions.
2005-04-07Fix indirect type parsing (functions, arrays, bitfields). UpdateLinus Torvalds1-0/+2
users to match. Examine array type sizes. Evaluate 'sizeof()', and realize that you can dereference arrays as well as pointers.
2005-04-07Handle 'enum' type sizing and alignmentLinus Torvalds1-0/+6
2005-04-07Add type size and alignment information to 'struct symbol'.Linus Torvalds1-0/+30
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.