summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorZuhaitz Méndez Fernández de Aránguiz <zuhaitz@debian>2026-02-02 00:33:12 +0000
committerZuhaitz Méndez Fernández de Aránguiz <zuhaitz@debian>2026-02-02 00:33:12 +0000
commitdadabf8b9d11d099777acc261068a3ed8ca06f24 (patch)
tree00576af42db9b7006556d815600140867fa970bd /src
parent6fde408251dcc0e32c6f513b5d65cc7a9d8c8912 (diff)
Fix concurrency suite compilation errors involving C typesdev/weilun/thread
Diffstat (limited to 'src')
-rw-r--r--src/ast/ast.c3
-rw-r--r--src/parser/parser_expr.c3
2 files changed, 4 insertions, 2 deletions
diff --git a/src/ast/ast.c b/src/ast/ast.c
index 1b35500..28fe678 100644
--- a/src/ast/ast.c
+++ b/src/ast/ast.c
@@ -101,6 +101,9 @@ int is_integer_type(Type *t)
t->kind == TYPE_ISIZE || t->kind == TYPE_BYTE || t->kind == TYPE_RUNE ||
t->kind == TYPE_UINT || t->kind == TYPE_I128 || t->kind == TYPE_U128 ||
t->kind == TYPE_BITINT || t->kind == TYPE_UBITINT ||
+ t->kind == TYPE_C_INT || t->kind == TYPE_C_UINT || t->kind == TYPE_C_LONG ||
+ t->kind == TYPE_C_ULONG || t->kind == TYPE_C_SHORT || t->kind == TYPE_C_USHORT ||
+ t->kind == TYPE_C_CHAR || t->kind == TYPE_C_UCHAR ||
(t->kind == TYPE_STRUCT && t->name &&
(0 == strcmp(t->name, "int8_t") || 0 == strcmp(t->name, "uint8_t") ||
0 == strcmp(t->name, "int16_t") || 0 == strcmp(t->name, "uint16_t") ||
diff --git a/src/parser/parser_expr.c b/src/parser/parser_expr.c
index a732448..f27e2c3 100644
--- a/src/parser/parser_expr.c
+++ b/src/parser/parser_expr.c
@@ -370,8 +370,7 @@ static void check_format_string(ASTNode *call, Token t)
if (spec == 'd' || spec == 'i' || spec == 'u' || spec == 'x' || spec == 'X' ||
spec == 'o')
{
- if (vt && vt->kind != TYPE_INT && vt->kind != TYPE_I64 && !type_is_unsigned(vt) &&
- vt->kind != TYPE_CHAR)
+ if (vt && !is_integer_type(vt))
{
warn_format_string(t, arg_num, "integer", got_type);
}