4 typedef unsigned int mode_t
;
6 extern void openat (int, const char *, int, mode_t
);
8 /* Signed vs unsigned of same integral type. */
11 test_1 (char const *name
, ...)
16 mode_t mode
= va_arg (arg
, mode_t
); /* { dg-bogus "-Wanalyzer-va-arg-type-mismatch" } */
19 openat (-42, name
, 0, mode
);
25 test_1 ("nonexist.ent/", 0600);
28 /* Not the same size: small enough for int promotion. */
33 test_2 (char const *name
, ...)
38 global_2
= va_arg (arg
, int16_t); /* { dg-warning "promoted to 'int'" } */
46 test_2 ("nonexist.ent/", 42);
49 /* Not the same size: too big for int promotion. */
54 test_3 (char const *name
, ...)
59 global_3
= va_arg (arg
, long long); /* { dg-warning "'va_arg' expected 'long long int' but received 'int' for variadic argument 1 of 'arg'" } */
67 test_3 ("nonexist.ent/", 42);