C++: relax ambiguously-signed-bit-field by allowing GLib's gboolean

The gboolean type of GLib (a widely used C library) is a typedef to int.
It is meant to represent a simple true/false value.

Resolves #7491
This commit is contained in:
László Várady
2021-12-30 13:35:58 +01:00
committed by Mathias Vorreiter Pedersen
parent bfb573c86a
commit 6496bf8c1d

View File

@@ -26,6 +26,8 @@ where
// At least for C programs on Windows, BOOL is a common typedef for a type
// representing BoolType.
not bf.getType().hasName("BOOL") and
// GLib's gboolean is a typedef for a type representing BoolType.
not bf.getType().hasName("gboolean") and
// If this is true, then there cannot be unsigned sign extension or overflow.
not bf.getDeclaredNumBits() = bf.getType().getSize() * 8 and
not bf.isAnonymous() and