mirror of
https://github.com/github/codeql.git
synced 2026-05-05 05:35:13 +02:00
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:
committed by
Mathias Vorreiter Pedersen
parent
bfb573c86a
commit
6496bf8c1d
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user