Skip to content

Fixing BasicIntTypes to allow C Standard Integers and 'bool' #18980

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 14, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions cpp/ql/src/JPL_C/LOC-3/Rule 17/BasicIntTypes.ql
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
import cpp

predicate allowedTypedefs(TypedefType t) {
t.getName() = ["I64", "U64", "I32", "U32", "I16", "U16", "I8", "U8", "F64", "F32"]
t.getName() = ["I64", "U64", "I32", "U32", "I16", "U16", "I8", "U8", "F64", "F32",
"int64_t", "uint64_t", "int32_t", "uint32_t", "int16_t", "uint16_t", "int8_t", "uint8_t"]
}

/**
Expand All @@ -38,8 +39,8 @@
}

predicate problematic(IntegralType t) {
// List any exceptions that should be allowed.
any()
// 'bool' is allowed as it represents a 'true' or 'false' value
t.getName() != ["bool"]
}

from Declaration d, Type usedType
Expand Down
4 changes: 4 additions & 0 deletions cpp/ql/src/change-notes/2025-03-11-basic-int-types.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
category: majorAnalysis
---
* The query "Basic Integral Types" in JPL_C has been updated to allow C standard integer types (uint8_t etc.) and 'bool'.
Loading