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@xxxxxxxxx> --- char.c | 4 ++-- target.c | 2 ++ target.h | 2 ++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/char.c b/char.c index e2b3863be..c52521bc8 100644 --- a/char.c +++ b/char.c @@ -84,7 +84,7 @@ void get_char_constant(struct token *token, unsigned long long *val) end = p + type - TOKEN_WIDE_CHAR; } p = parse_escape(p, &v, end, - type < TOKEN_WIDE_CHAR ? bits_in_char : 32, token->pos); + type < TOKEN_WIDE_CHAR ? bits_in_char : bits_in_wchar, token->pos); if (p != end) warning(token->pos, "multi-character character constant"); @@ -113,7 +113,7 @@ struct token *get_string_constant(struct token *token, struct expression *expr) done = next; } } - bits = is_wide ? 32 : bits_in_char; + bits = is_wide ? bits_in_wchar : bits_in_char; while (token != done) { unsigned v; const char *p = token->string->data; diff --git a/target.c b/target.c index 17b228ae9..86a9e2e63 100644 --- a/target.c +++ b/target.c @@ -22,6 +22,8 @@ int bits_in_long = 32; int bits_in_longlong = 64; int bits_in_longlonglong = 128; +int bits_in_wchar = 32; + int max_int_alignment = 4; /* diff --git a/target.h b/target.h index 78c85cf7e..8326fa21a 100644 --- a/target.h +++ b/target.h @@ -20,6 +20,8 @@ extern int bits_in_long; extern int bits_in_longlong; extern int bits_in_longlonglong; +extern int bits_in_wchar; + extern int max_int_alignment; /* -- 2.13.0 -- To unsubscribe from this list: send the line "unsubscribe linux-sparse" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html