On 20/10/2019 20:12, Luc Van Oostenryck wrote:
On Wed, Sep 25, 2019 at 11:00:13AM +0100, Ben Dooks wrote:
+static int printf_fmt_numtype(struct format_type *fmt, struct expression **expr, struct symbol *ctype, struct symbol **target, const char **typediff)
+{
+ struct symbol *type = fmt->data;
+ *target = type;
+ return ctype == type;
Comparing these pointer will never be the correct way to compare the
types. You have to use something like check_assignment_types().
Currently, a simple test like:
void print(const char *, ...) __attribute__((format(printf, 1, 2)));
static void foo(unsigned int u)
{
print("%x\n", u);
}
gives a warning like:
warning: incorrect type in argument 2 (different types)
expected unsigned int
got unsigned int u
-- Luc
ok, thanks for pointing this out.
--
Ben Dooks http://www.codethink.co.uk/
Senior Engineer Codethink - Providing Genius
https://www.codethink.co.uk/privacy.html