diff options
author | Philip Withnall <philip.withnall@collabora.co.uk> | 2014-05-06 14:56:39 +0100 |
---|---|---|
committer | Philip Withnall <philip.withnall@collabora.co.uk> | 2014-05-06 14:56:39 +0100 |
commit | 72fe9085710e7170e88249a112e201fafe37f080 (patch) | |
tree | 2b1149d0e5ae44eaeab1e3e545b53d04d25e0e5a /tests | |
parent | 6977a14d9d9f074d0196b8abd2fa60388a40a87f (diff) |
clang-plugin: Don’t confuse integer constants with NULL
The integer constant 0 can be interpreted as NULL, so only perform NULL
pointer checks when the expected type is a pointer.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/gvariant-new.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/gvariant-new.c b/tests/gvariant-new.c index 45f1f13..6a787b2 100644 --- a/tests/gvariant-new.c +++ b/tests/gvariant-new.c @@ -177,6 +177,14 @@ } /* + * No error + */ +{ + // This could be interpreted as a NULL pointer constant. + floating_variant = g_variant_new ("u", 0); +} + +/* * Expected a GVariant variadic argument of type ‘long’ but saw one of type ‘char *’. * floating_variant = g_variant_new ("x", "nope"); * ^ |