From 421866e55b2b106321b62f8c39d8d0582cd7dab2 Mon Sep 17 00:00:00 2001 From: Jeroen Ketema Date: Tue, 6 Jan 2026 16:23:19 +0100 Subject: [PATCH 01/38] Floating point decimal support has been removed from CodeQL --- c/common/src/codingstandards/c/Extensions.qll | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/c/common/src/codingstandards/c/Extensions.qll b/c/common/src/codingstandards/c/Extensions.qll index 4f16a1f09a..dc2618d5ba 100644 --- a/c/common/src/codingstandards/c/Extensions.qll +++ b/c/common/src/codingstandards/c/Extensions.qll @@ -120,12 +120,7 @@ class CTerseTernaryExtension extends CCompilerExtension, ConditionalExpr { // Reference: https://gcc.gnu.org/onlinedocs/gcc/_005f_005fint128.html#g_t_005f_005fint128 // Reference: https://gcc.gnu.org/onlinedocs/gcc/Decimal-Float.html#Decimal-Float class CRealTypeExtensionExtension extends CCompilerExtension, DeclarationEntry { - CRealTypeExtensionExtension() { - getType() instanceof Decimal128Type or - getType() instanceof Decimal32Type or - getType() instanceof Decimal64Type or - getType() instanceof Float128Type - } + CRealTypeExtensionExtension() { getType() instanceof Float128Type } override string getMessage() { result = "Decimal floats are a compiler extension and are not portable to other compilers." From 141d5be42766520b4a993711e3f660a1494b458b Mon Sep 17 00:00:00 2001 From: Mathias Vorreiter Pedersen Date: Wed, 11 Feb 2026 20:01:49 +0000 Subject: [PATCH 02/38] C++: Accept test changes after github/codeql#21313. --- ...NegativeOrGreaterPrecisionOperand.expected | 112 ++++++++++-------- c/cert/test/rules/INT34-C/test.c | 8 +- 2 files changed, 64 insertions(+), 56 deletions(-) diff --git a/c/cert/test/rules/INT34-C/ExprShiftedbyNegativeOrGreaterPrecisionOperand.expected b/c/cert/test/rules/INT34-C/ExprShiftedbyNegativeOrGreaterPrecisionOperand.expected index dc92d0f1be..ca73e82c1d 100644 --- a/c/cert/test/rules/INT34-C/ExprShiftedbyNegativeOrGreaterPrecisionOperand.expected +++ b/c/cert/test/rules/INT34-C/ExprShiftedbyNegativeOrGreaterPrecisionOperand.expected @@ -8,9 +8,9 @@ | test.c:59:3:59:14 | ... << ... | The operand 'lhs0' is shifted by an expression 'rhs9' whose upper bound (32) is greater than or equal to the precision. | | test.c:61:3:61:15 | ... << ... | The operand 'lhs0' is shifted by an expression 'rhs10' whose upper bound (31) is greater than or equal to the precision. | | test.c:63:3:63:15 | ... << ... | The operand 'lhs0' is shifted by an expression 'rhs11' whose upper bound (31) is greater than or equal to the precision. | -| test.c:65:3:65:15 | ... << ... | The operand 'lhs0' is shifted by an expression 'rhs12' whose upper bound (64) is greater than or equal to the precision. | -| test.c:67:3:67:15 | ... << ... | The operand 'lhs0' is shifted by an expression 'rhs13' whose upper bound (63) is greater than or equal to the precision. | -| test.c:69:3:69:15 | ... << ... | The operand 'lhs0' is shifted by an expression 'rhs14' whose upper bound (63) is greater than or equal to the precision. | +| test.c:65:3:65:15 | ... << ... | The operand 'lhs0' is shifted by an expression 'rhs12' whose upper bound (127) is greater than or equal to the precision. | +| test.c:67:3:67:15 | ... << ... | The operand 'lhs0' is shifted by an expression 'rhs13' whose upper bound (127) is greater than or equal to the precision. | +| test.c:69:3:69:15 | ... << ... | The operand 'lhs0' is shifted by an expression 'rhs14' whose upper bound (127) is greater than or equal to the precision. | | test.c:71:3:71:14 | ... << ... | The operand 'lhs1' is shifted by an expression 'rhs0' whose upper bound (8) is greater than or equal to the precision. | | test.c:73:3:73:14 | ... << ... | The operand 'lhs1' is shifted by an expression 'rhs1' whose upper bound (7) is greater than or equal to the precision. | | test.c:75:3:75:14 | ... << ... | The operand 'lhs1' is shifted by an expression 'rhs2' whose upper bound (7) is greater than or equal to the precision. | @@ -23,9 +23,9 @@ | test.c:89:3:89:14 | ... << ... | The operand 'lhs1' is shifted by an expression 'rhs9' whose upper bound (32) is greater than or equal to the precision. | | test.c:91:3:91:15 | ... << ... | The operand 'lhs1' is shifted by an expression 'rhs10' whose upper bound (31) is greater than or equal to the precision. | | test.c:93:3:93:15 | ... << ... | The operand 'lhs1' is shifted by an expression 'rhs11' whose upper bound (31) is greater than or equal to the precision. | -| test.c:95:3:95:15 | ... << ... | The operand 'lhs1' is shifted by an expression 'rhs12' whose upper bound (64) is greater than or equal to the precision. | -| test.c:97:3:97:15 | ... << ... | The operand 'lhs1' is shifted by an expression 'rhs13' whose upper bound (63) is greater than or equal to the precision. | -| test.c:99:3:99:15 | ... << ... | The operand 'lhs1' is shifted by an expression 'rhs14' whose upper bound (63) is greater than or equal to the precision. | +| test.c:95:3:95:15 | ... << ... | The operand 'lhs1' is shifted by an expression 'rhs12' whose upper bound (127) is greater than or equal to the precision. | +| test.c:97:3:97:15 | ... << ... | The operand 'lhs1' is shifted by an expression 'rhs13' whose upper bound (127) is greater than or equal to the precision. | +| test.c:99:3:99:15 | ... << ... | The operand 'lhs1' is shifted by an expression 'rhs14' whose upper bound (127) is greater than or equal to the precision. | | test.c:134:3:134:14 | ... << ... | The operand 'lhs3' is shifted by an expression 'rhs3' whose upper bound (16) is greater than or equal to the precision. | | test.c:138:3:138:14 | ... << ... | The operand 'lhs3' is shifted by an expression 'rhs6' whose upper bound (32) is greater than or equal to the precision. | | test.c:140:3:140:14 | ... << ... | The operand 'lhs3' is shifted by an expression 'rhs7' whose upper bound (31) is greater than or equal to the precision. | @@ -33,9 +33,9 @@ | test.c:144:3:144:14 | ... << ... | The operand 'lhs3' is shifted by an expression 'rhs9' whose upper bound (32) is greater than or equal to the precision. | | test.c:146:3:146:15 | ... << ... | The operand 'lhs3' is shifted by an expression 'rhs10' whose upper bound (31) is greater than or equal to the precision. | | test.c:148:3:148:15 | ... << ... | The operand 'lhs3' is shifted by an expression 'rhs11' whose upper bound (31) is greater than or equal to the precision. | -| test.c:150:3:150:15 | ... << ... | The operand 'lhs3' is shifted by an expression 'rhs12' whose upper bound (64) is greater than or equal to the precision. | -| test.c:152:3:152:15 | ... << ... | The operand 'lhs3' is shifted by an expression 'rhs13' whose upper bound (63) is greater than or equal to the precision. | -| test.c:154:3:154:15 | ... << ... | The operand 'lhs3' is shifted by an expression 'rhs14' whose upper bound (63) is greater than or equal to the precision. | +| test.c:150:3:150:15 | ... << ... | The operand 'lhs3' is shifted by an expression 'rhs12' whose upper bound (127) is greater than or equal to the precision. | +| test.c:152:3:152:15 | ... << ... | The operand 'lhs3' is shifted by an expression 'rhs13' whose upper bound (127) is greater than or equal to the precision. | +| test.c:154:3:154:15 | ... << ... | The operand 'lhs3' is shifted by an expression 'rhs14' whose upper bound (127) is greater than or equal to the precision. | | test.c:159:3:159:14 | ... << ... | The operand 'lhs4' is shifted by an expression 'rhs3' whose upper bound (16) is greater than or equal to the precision. | | test.c:161:3:161:14 | ... << ... | The operand 'lhs4' is shifted by an expression 'rhs4' whose upper bound (15) is greater than or equal to the precision. | | test.c:163:3:163:14 | ... << ... | The operand 'lhs4' is shifted by an expression 'rhs5' whose upper bound (15) is greater than or equal to the precision. | @@ -45,31 +45,35 @@ | test.c:171:3:171:14 | ... << ... | The operand 'lhs4' is shifted by an expression 'rhs9' whose upper bound (32) is greater than or equal to the precision. | | test.c:173:3:173:15 | ... << ... | The operand 'lhs4' is shifted by an expression 'rhs10' whose upper bound (31) is greater than or equal to the precision. | | test.c:175:3:175:15 | ... << ... | The operand 'lhs4' is shifted by an expression 'rhs11' whose upper bound (31) is greater than or equal to the precision. | -| test.c:177:3:177:15 | ... << ... | The operand 'lhs4' is shifted by an expression 'rhs12' whose upper bound (64) is greater than or equal to the precision. | -| test.c:179:3:179:15 | ... << ... | The operand 'lhs4' is shifted by an expression 'rhs13' whose upper bound (63) is greater than or equal to the precision. | -| test.c:181:3:181:15 | ... << ... | The operand 'lhs4' is shifted by an expression 'rhs14' whose upper bound (63) is greater than or equal to the precision. | +| test.c:177:3:177:15 | ... << ... | The operand 'lhs4' is shifted by an expression 'rhs12' whose upper bound (127) is greater than or equal to the precision. | +| test.c:179:3:179:15 | ... << ... | The operand 'lhs4' is shifted by an expression 'rhs13' whose upper bound (127) is greater than or equal to the precision. | +| test.c:181:3:181:15 | ... << ... | The operand 'lhs4' is shifted by an expression 'rhs14' whose upper bound (127) is greater than or equal to the precision. | | test.c:216:3:216:14 | ... << ... | The operand 'lhs6' is shifted by an expression 'rhs6' whose upper bound (32) is greater than or equal to the precision. | | test.c:220:3:220:14 | ... << ... | The operand 'lhs6' is shifted by an expression 'rhs9' whose upper bound (32) is greater than or equal to the precision. | -| test.c:224:3:224:15 | ... << ... | The operand 'lhs6' is shifted by an expression 'rhs12' whose upper bound (64) is greater than or equal to the precision. | -| test.c:226:3:226:15 | ... << ... | The operand 'lhs6' is shifted by an expression 'rhs13' whose upper bound (63) is greater than or equal to the precision. | -| test.c:228:3:228:15 | ... << ... | The operand 'lhs6' is shifted by an expression 'rhs14' whose upper bound (63) is greater than or equal to the precision. | +| test.c:224:3:224:15 | ... << ... | The operand 'lhs6' is shifted by an expression 'rhs12' whose upper bound (127) is greater than or equal to the precision. | +| test.c:226:3:226:15 | ... << ... | The operand 'lhs6' is shifted by an expression 'rhs13' whose upper bound (127) is greater than or equal to the precision. | +| test.c:228:3:228:15 | ... << ... | The operand 'lhs6' is shifted by an expression 'rhs14' whose upper bound (127) is greater than or equal to the precision. | | test.c:236:3:236:14 | ... << ... | The operand 'lhs7' is shifted by an expression 'rhs6' whose upper bound (32) is greater than or equal to the precision. | | test.c:238:3:238:14 | ... << ... | The operand 'lhs7' is shifted by an expression 'rhs7' whose upper bound (31) is greater than or equal to the precision. | | test.c:240:3:240:14 | ... << ... | The operand 'lhs7' is shifted by an expression 'rhs8' whose upper bound (31) is greater than or equal to the precision. | | test.c:242:3:242:14 | ... << ... | The operand 'lhs7' is shifted by an expression 'rhs9' whose upper bound (32) is greater than or equal to the precision. | | test.c:244:3:244:15 | ... << ... | The operand 'lhs7' is shifted by an expression 'rhs10' whose upper bound (31) is greater than or equal to the precision. | | test.c:246:3:246:15 | ... << ... | The operand 'lhs7' is shifted by an expression 'rhs11' whose upper bound (31) is greater than or equal to the precision. | -| test.c:248:3:248:15 | ... << ... | The operand 'lhs7' is shifted by an expression 'rhs12' whose upper bound (64) is greater than or equal to the precision. | -| test.c:250:3:250:15 | ... << ... | The operand 'lhs7' is shifted by an expression 'rhs13' whose upper bound (63) is greater than or equal to the precision. | -| test.c:252:3:252:15 | ... << ... | The operand 'lhs7' is shifted by an expression 'rhs14' whose upper bound (63) is greater than or equal to the precision. | -| test.c:292:3:292:15 | ... << ... | The operand 'lhs9' is shifted by an expression 'rhs12' whose upper bound (64) is greater than or equal to the precision. | -| test.c:316:3:316:16 | ... << ... | The operand 'lhs10' is shifted by an expression 'rhs12' whose upper bound (64) is greater than or equal to the precision. | -| test.c:318:3:318:16 | ... << ... | The operand 'lhs10' is shifted by an expression 'rhs13' whose upper bound (63) is greater than or equal to the precision. | -| test.c:320:3:320:16 | ... << ... | The operand 'lhs10' is shifted by an expression 'rhs14' whose upper bound (63) is greater than or equal to the precision. | -| test.c:358:3:358:16 | ... << ... | The operand 'lhs12' is shifted by an expression 'rhs12' whose upper bound (64) is greater than or equal to the precision. | -| test.c:374:3:374:16 | ... << ... | The operand 'lhs13' is shifted by an expression 'rhs12' whose upper bound (64) is greater than or equal to the precision. | -| test.c:376:3:376:16 | ... << ... | The operand 'lhs13' is shifted by an expression 'rhs13' whose upper bound (63) is greater than or equal to the precision. | -| test.c:378:3:378:16 | ... << ... | The operand 'lhs13' is shifted by an expression 'rhs14' whose upper bound (63) is greater than or equal to the precision. | +| test.c:248:3:248:15 | ... << ... | The operand 'lhs7' is shifted by an expression 'rhs12' whose upper bound (127) is greater than or equal to the precision. | +| test.c:250:3:250:15 | ... << ... | The operand 'lhs7' is shifted by an expression 'rhs13' whose upper bound (127) is greater than or equal to the precision. | +| test.c:252:3:252:15 | ... << ... | The operand 'lhs7' is shifted by an expression 'rhs14' whose upper bound (127) is greater than or equal to the precision. | +| test.c:292:3:292:15 | ... << ... | The operand 'lhs9' is shifted by an expression 'rhs12' whose upper bound (127) is greater than or equal to the precision. | +| test.c:294:3:294:15 | ... << ... | The operand 'lhs9' is shifted by an expression 'rhs13' whose upper bound (127) is greater than or equal to the precision. | +| test.c:296:3:296:15 | ... << ... | The operand 'lhs9' is shifted by an expression 'rhs14' whose upper bound (127) is greater than or equal to the precision. | +| test.c:316:3:316:16 | ... << ... | The operand 'lhs10' is shifted by an expression 'rhs12' whose upper bound (127) is greater than or equal to the precision. | +| test.c:318:3:318:16 | ... << ... | The operand 'lhs10' is shifted by an expression 'rhs13' whose upper bound (127) is greater than or equal to the precision. | +| test.c:320:3:320:16 | ... << ... | The operand 'lhs10' is shifted by an expression 'rhs14' whose upper bound (127) is greater than or equal to the precision. | +| test.c:358:3:358:16 | ... << ... | The operand 'lhs12' is shifted by an expression 'rhs12' whose upper bound (127) is greater than or equal to the precision. | +| test.c:360:3:360:16 | ... << ... | The operand 'lhs12' is shifted by an expression 'rhs13' whose upper bound (127) is greater than or equal to the precision. | +| test.c:361:3:361:16 | ... << ... | The operand 'lhs12' is shifted by an expression 'rhs14' whose upper bound (127) is greater than or equal to the precision. | +| test.c:374:3:374:16 | ... << ... | The operand 'lhs13' is shifted by an expression 'rhs12' whose upper bound (127) is greater than or equal to the precision. | +| test.c:376:3:376:16 | ... << ... | The operand 'lhs13' is shifted by an expression 'rhs13' whose upper bound (127) is greater than or equal to the precision. | +| test.c:378:3:378:16 | ... << ... | The operand 'lhs13' is shifted by an expression 'rhs14' whose upper bound (127) is greater than or equal to the precision. | | test.c:1579:3:1580:10 | ... >> ... | The operand 'lhs0' is shifted by an expression 'rhs0' whose upper bound (8) is greater than or equal to the precision. | | test.c:1583:3:1584:10 | ... >> ... | The operand 'lhs0' is shifted by an expression 'rhs3' whose upper bound (16) is greater than or equal to the precision. | | test.c:1585:3:1586:10 | ... >> ... | The operand 'lhs0' is shifted by an expression 'rhs4' whose upper bound (15) is greater than or equal to the precision. | @@ -80,9 +84,9 @@ | test.c:1595:3:1596:10 | ... >> ... | The operand 'lhs0' is shifted by an expression 'rhs9' whose upper bound (32) is greater than or equal to the precision. | | test.c:1597:3:1597:15 | ... >> ... | The operand 'lhs0' is shifted by an expression 'rhs10' whose upper bound (31) is greater than or equal to the precision. | | test.c:1599:3:1599:15 | ... >> ... | The operand 'lhs0' is shifted by an expression 'rhs11' whose upper bound (31) is greater than or equal to the precision. | -| test.c:1601:3:1601:15 | ... >> ... | The operand 'lhs0' is shifted by an expression 'rhs12' whose upper bound (64) is greater than or equal to the precision. | -| test.c:1603:3:1603:15 | ... >> ... | The operand 'lhs0' is shifted by an expression 'rhs13' whose upper bound (63) is greater than or equal to the precision. | -| test.c:1605:3:1605:15 | ... >> ... | The operand 'lhs0' is shifted by an expression 'rhs14' whose upper bound (63) is greater than or equal to the precision. | +| test.c:1601:3:1601:15 | ... >> ... | The operand 'lhs0' is shifted by an expression 'rhs12' whose upper bound (127) is greater than or equal to the precision. | +| test.c:1603:3:1603:15 | ... >> ... | The operand 'lhs0' is shifted by an expression 'rhs13' whose upper bound (127) is greater than or equal to the precision. | +| test.c:1605:3:1605:15 | ... >> ... | The operand 'lhs0' is shifted by an expression 'rhs14' whose upper bound (127) is greater than or equal to the precision. | | test.c:1607:3:1608:10 | ... >> ... | The operand 'lhs1' is shifted by an expression 'rhs0' whose upper bound (8) is greater than or equal to the precision. | | test.c:1609:3:1610:10 | ... >> ... | The operand 'lhs1' is shifted by an expression 'rhs1' whose upper bound (7) is greater than or equal to the precision. | | test.c:1611:3:1612:10 | ... >> ... | The operand 'lhs1' is shifted by an expression 'rhs2' whose upper bound (7) is greater than or equal to the precision. | @@ -95,9 +99,9 @@ | test.c:1625:3:1626:10 | ... >> ... | The operand 'lhs1' is shifted by an expression 'rhs9' whose upper bound (32) is greater than or equal to the precision. | | test.c:1627:3:1627:15 | ... >> ... | The operand 'lhs1' is shifted by an expression 'rhs10' whose upper bound (31) is greater than or equal to the precision. | | test.c:1629:3:1629:15 | ... >> ... | The operand 'lhs1' is shifted by an expression 'rhs11' whose upper bound (31) is greater than or equal to the precision. | -| test.c:1631:3:1631:15 | ... >> ... | The operand 'lhs1' is shifted by an expression 'rhs12' whose upper bound (64) is greater than or equal to the precision. | -| test.c:1633:3:1633:15 | ... >> ... | The operand 'lhs1' is shifted by an expression 'rhs13' whose upper bound (63) is greater than or equal to the precision. | -| test.c:1635:3:1635:15 | ... >> ... | The operand 'lhs1' is shifted by an expression 'rhs14' whose upper bound (63) is greater than or equal to the precision. | +| test.c:1631:3:1631:15 | ... >> ... | The operand 'lhs1' is shifted by an expression 'rhs12' whose upper bound (127) is greater than or equal to the precision. | +| test.c:1633:3:1633:15 | ... >> ... | The operand 'lhs1' is shifted by an expression 'rhs13' whose upper bound (127) is greater than or equal to the precision. | +| test.c:1635:3:1635:15 | ... >> ... | The operand 'lhs1' is shifted by an expression 'rhs14' whose upper bound (127) is greater than or equal to the precision. | | test.c:1670:3:1671:10 | ... >> ... | The operand 'lhs3' is shifted by an expression 'rhs3' whose upper bound (16) is greater than or equal to the precision. | | test.c:1674:3:1675:10 | ... >> ... | The operand 'lhs3' is shifted by an expression 'rhs6' whose upper bound (32) is greater than or equal to the precision. | | test.c:1676:3:1677:10 | ... >> ... | The operand 'lhs3' is shifted by an expression 'rhs7' whose upper bound (31) is greater than or equal to the precision. | @@ -105,9 +109,9 @@ | test.c:1680:3:1681:10 | ... >> ... | The operand 'lhs3' is shifted by an expression 'rhs9' whose upper bound (32) is greater than or equal to the precision. | | test.c:1682:3:1682:15 | ... >> ... | The operand 'lhs3' is shifted by an expression 'rhs10' whose upper bound (31) is greater than or equal to the precision. | | test.c:1684:3:1684:15 | ... >> ... | The operand 'lhs3' is shifted by an expression 'rhs11' whose upper bound (31) is greater than or equal to the precision. | -| test.c:1686:3:1686:15 | ... >> ... | The operand 'lhs3' is shifted by an expression 'rhs12' whose upper bound (64) is greater than or equal to the precision. | -| test.c:1688:3:1688:15 | ... >> ... | The operand 'lhs3' is shifted by an expression 'rhs13' whose upper bound (63) is greater than or equal to the precision. | -| test.c:1690:3:1690:15 | ... >> ... | The operand 'lhs3' is shifted by an expression 'rhs14' whose upper bound (63) is greater than or equal to the precision. | +| test.c:1686:3:1686:15 | ... >> ... | The operand 'lhs3' is shifted by an expression 'rhs12' whose upper bound (127) is greater than or equal to the precision. | +| test.c:1688:3:1688:15 | ... >> ... | The operand 'lhs3' is shifted by an expression 'rhs13' whose upper bound (127) is greater than or equal to the precision. | +| test.c:1690:3:1690:15 | ... >> ... | The operand 'lhs3' is shifted by an expression 'rhs14' whose upper bound (127) is greater than or equal to the precision. | | test.c:1695:3:1696:10 | ... >> ... | The operand 'lhs4' is shifted by an expression 'rhs3' whose upper bound (16) is greater than or equal to the precision. | | test.c:1697:3:1698:10 | ... >> ... | The operand 'lhs4' is shifted by an expression 'rhs4' whose upper bound (15) is greater than or equal to the precision. | | test.c:1699:3:1700:10 | ... >> ... | The operand 'lhs4' is shifted by an expression 'rhs5' whose upper bound (15) is greater than or equal to the precision. | @@ -117,31 +121,35 @@ | test.c:1707:3:1708:10 | ... >> ... | The operand 'lhs4' is shifted by an expression 'rhs9' whose upper bound (32) is greater than or equal to the precision. | | test.c:1709:3:1709:15 | ... >> ... | The operand 'lhs4' is shifted by an expression 'rhs10' whose upper bound (31) is greater than or equal to the precision. | | test.c:1711:3:1711:15 | ... >> ... | The operand 'lhs4' is shifted by an expression 'rhs11' whose upper bound (31) is greater than or equal to the precision. | -| test.c:1713:3:1713:15 | ... >> ... | The operand 'lhs4' is shifted by an expression 'rhs12' whose upper bound (64) is greater than or equal to the precision. | -| test.c:1715:3:1715:15 | ... >> ... | The operand 'lhs4' is shifted by an expression 'rhs13' whose upper bound (63) is greater than or equal to the precision. | -| test.c:1717:3:1717:15 | ... >> ... | The operand 'lhs4' is shifted by an expression 'rhs14' whose upper bound (63) is greater than or equal to the precision. | +| test.c:1713:3:1713:15 | ... >> ... | The operand 'lhs4' is shifted by an expression 'rhs12' whose upper bound (127) is greater than or equal to the precision. | +| test.c:1715:3:1715:15 | ... >> ... | The operand 'lhs4' is shifted by an expression 'rhs13' whose upper bound (127) is greater than or equal to the precision. | +| test.c:1717:3:1717:15 | ... >> ... | The operand 'lhs4' is shifted by an expression 'rhs14' whose upper bound (127) is greater than or equal to the precision. | | test.c:1752:3:1753:10 | ... >> ... | The operand 'lhs6' is shifted by an expression 'rhs6' whose upper bound (32) is greater than or equal to the precision. | | test.c:1756:3:1757:10 | ... >> ... | The operand 'lhs6' is shifted by an expression 'rhs9' whose upper bound (32) is greater than or equal to the precision. | -| test.c:1760:3:1760:15 | ... >> ... | The operand 'lhs6' is shifted by an expression 'rhs12' whose upper bound (64) is greater than or equal to the precision. | -| test.c:1762:3:1762:15 | ... >> ... | The operand 'lhs6' is shifted by an expression 'rhs13' whose upper bound (63) is greater than or equal to the precision. | -| test.c:1764:3:1764:15 | ... >> ... | The operand 'lhs6' is shifted by an expression 'rhs14' whose upper bound (63) is greater than or equal to the precision. | +| test.c:1760:3:1760:15 | ... >> ... | The operand 'lhs6' is shifted by an expression 'rhs12' whose upper bound (127) is greater than or equal to the precision. | +| test.c:1762:3:1762:15 | ... >> ... | The operand 'lhs6' is shifted by an expression 'rhs13' whose upper bound (127) is greater than or equal to the precision. | +| test.c:1764:3:1764:15 | ... >> ... | The operand 'lhs6' is shifted by an expression 'rhs14' whose upper bound (127) is greater than or equal to the precision. | | test.c:1772:3:1773:10 | ... >> ... | The operand 'lhs7' is shifted by an expression 'rhs6' whose upper bound (32) is greater than or equal to the precision. | | test.c:1774:3:1775:10 | ... >> ... | The operand 'lhs7' is shifted by an expression 'rhs7' whose upper bound (31) is greater than or equal to the precision. | | test.c:1776:3:1777:10 | ... >> ... | The operand 'lhs7' is shifted by an expression 'rhs8' whose upper bound (31) is greater than or equal to the precision. | | test.c:1778:3:1779:10 | ... >> ... | The operand 'lhs7' is shifted by an expression 'rhs9' whose upper bound (32) is greater than or equal to the precision. | | test.c:1780:3:1780:15 | ... >> ... | The operand 'lhs7' is shifted by an expression 'rhs10' whose upper bound (31) is greater than or equal to the precision. | | test.c:1782:3:1782:15 | ... >> ... | The operand 'lhs7' is shifted by an expression 'rhs11' whose upper bound (31) is greater than or equal to the precision. | -| test.c:1784:3:1784:15 | ... >> ... | The operand 'lhs7' is shifted by an expression 'rhs12' whose upper bound (64) is greater than or equal to the precision. | -| test.c:1786:3:1786:15 | ... >> ... | The operand 'lhs7' is shifted by an expression 'rhs13' whose upper bound (63) is greater than or equal to the precision. | -| test.c:1788:3:1788:15 | ... >> ... | The operand 'lhs7' is shifted by an expression 'rhs14' whose upper bound (63) is greater than or equal to the precision. | -| test.c:1828:3:1828:15 | ... >> ... | The operand 'lhs9' is shifted by an expression 'rhs12' whose upper bound (64) is greater than or equal to the precision. | -| test.c:1852:3:1852:16 | ... >> ... | The operand 'lhs10' is shifted by an expression 'rhs12' whose upper bound (64) is greater than or equal to the precision. | -| test.c:1854:3:1854:16 | ... >> ... | The operand 'lhs10' is shifted by an expression 'rhs13' whose upper bound (63) is greater than or equal to the precision. | -| test.c:1856:3:1856:16 | ... >> ... | The operand 'lhs10' is shifted by an expression 'rhs14' whose upper bound (63) is greater than or equal to the precision. | -| test.c:1894:3:1894:16 | ... >> ... | The operand 'lhs12' is shifted by an expression 'rhs12' whose upper bound (64) is greater than or equal to the precision. | -| test.c:1910:3:1910:16 | ... >> ... | The operand 'lhs13' is shifted by an expression 'rhs12' whose upper bound (64) is greater than or equal to the precision. | -| test.c:1912:3:1912:16 | ... >> ... | The operand 'lhs13' is shifted by an expression 'rhs13' whose upper bound (63) is greater than or equal to the precision. | -| test.c:1914:3:1914:16 | ... >> ... | The operand 'lhs13' is shifted by an expression 'rhs14' whose upper bound (63) is greater than or equal to the precision. | +| test.c:1784:3:1784:15 | ... >> ... | The operand 'lhs7' is shifted by an expression 'rhs12' whose upper bound (127) is greater than or equal to the precision. | +| test.c:1786:3:1786:15 | ... >> ... | The operand 'lhs7' is shifted by an expression 'rhs13' whose upper bound (127) is greater than or equal to the precision. | +| test.c:1788:3:1788:15 | ... >> ... | The operand 'lhs7' is shifted by an expression 'rhs14' whose upper bound (127) is greater than or equal to the precision. | +| test.c:1828:3:1828:15 | ... >> ... | The operand 'lhs9' is shifted by an expression 'rhs12' whose upper bound (127) is greater than or equal to the precision. | +| test.c:1830:3:1830:15 | ... >> ... | The operand 'lhs9' is shifted by an expression 'rhs13' whose upper bound (127) is greater than or equal to the precision. | +| test.c:1832:3:1832:15 | ... >> ... | The operand 'lhs9' is shifted by an expression 'rhs14' whose upper bound (127) is greater than or equal to the precision. | +| test.c:1852:3:1852:16 | ... >> ... | The operand 'lhs10' is shifted by an expression 'rhs12' whose upper bound (127) is greater than or equal to the precision. | +| test.c:1854:3:1854:16 | ... >> ... | The operand 'lhs10' is shifted by an expression 'rhs13' whose upper bound (127) is greater than or equal to the precision. | +| test.c:1856:3:1856:16 | ... >> ... | The operand 'lhs10' is shifted by an expression 'rhs14' whose upper bound (127) is greater than or equal to the precision. | +| test.c:1894:3:1894:16 | ... >> ... | The operand 'lhs12' is shifted by an expression 'rhs12' whose upper bound (127) is greater than or equal to the precision. | +| test.c:1896:3:1896:16 | ... >> ... | The operand 'lhs12' is shifted by an expression 'rhs13' whose upper bound (127) is greater than or equal to the precision. | +| test.c:1897:3:1897:16 | ... >> ... | The operand 'lhs12' is shifted by an expression 'rhs14' whose upper bound (127) is greater than or equal to the precision. | +| test.c:1910:3:1910:16 | ... >> ... | The operand 'lhs13' is shifted by an expression 'rhs12' whose upper bound (127) is greater than or equal to the precision. | +| test.c:1912:3:1912:16 | ... >> ... | The operand 'lhs13' is shifted by an expression 'rhs13' whose upper bound (127) is greater than or equal to the precision. | +| test.c:1914:3:1914:16 | ... >> ... | The operand 'lhs13' is shifted by an expression 'rhs14' whose upper bound (127) is greater than or equal to the precision. | | test.c:3115:3:3115:12 | ... << ... | The operand 'lhs0' is shifted by an expression '- ...' which may be negative. | | test.c:3116:3:3116:12 | ... << ... | The operand 'lhs1' is shifted by an expression '- ...' which may be negative. | | test.c:3117:3:3117:12 | ... << ... | The operand 'lhs2' is shifted by an expression '- ...' which may be negative. | diff --git a/c/cert/test/rules/INT34-C/test.c b/c/cert/test/rules/INT34-C/test.c index c47df4b55d..6248f75313 100644 --- a/c/cert/test/rules/INT34-C/test.c +++ b/c/cert/test/rules/INT34-C/test.c @@ -357,8 +357,8 @@ int main() { lhs12 << rhs11; // COMPLIANT: lhs12's precision is strictly greater than rhs11 lhs12 << rhs12; // NON_COMPLIANT: lhs12's precision is not strictly greater // than rhs12's - lhs12 << rhs13; // COMPLIANT: lhs12's precision is strictly greater than rhs13 - lhs12 << rhs14; // COMPLIANT: lhs12's precision is strictly greater than rhs14 + lhs12 << rhs13; // COMPLIANT[FALSE POSITIVE]: lhs12's precision is strictly greater than rhs13 (FP because range analysis reduced precision for performance reasons) + lhs12 << rhs14; // COMPLIANT[FALSE POSITIVE]: lhs12's precision is strictly greater than rhs14 (FP because range analysis reduced precision for performance reasons) lhs13 << rhs0; // COMPLIANT: lhs13's precision is strictly greater than rhs0 lhs13 << rhs1; // COMPLIANT: lhs13's precision is strictly greater than rhs1 lhs13 << rhs2; // COMPLIANT: lhs13's precision is strictly greater than rhs2 @@ -1893,8 +1893,8 @@ int main() { lhs12 >> rhs11; // COMPLIANT: lhs12's precision is strictly greater than rhs11 lhs12 >> rhs12; // NON_COMPLIANT: lhs12's precision is not strictly greater // than rhs12 - lhs12 >> rhs13; // COMPLIANT: lhs12's precision is strictly greater than rhs13 - lhs12 >> rhs14; // COMPLIANT: lhs12's precision is strictly greater than rhs14 + lhs12 >> rhs13; // COMPLIANT[FALSE POSITIVE]: lhs12's precision is strictly greater than rhs13 (FP because range analysis reduced precision for performance reasons) + lhs12 >> rhs14; // COMPLIANT[FALSE POSITIVE]: lhs12's precision is strictly greater than rhs14 (FP because range analysis reduced precision for performance reasons) lhs13 >> rhs0; // COMPLIANT: lhs13's precision is strictly greater than rhs0 lhs13 >> rhs1; // COMPLIANT: lhs13's precision is strictly greater than rhs1 lhs13 >> rhs2; // COMPLIANT: lhs13's precision is strictly greater than rhs2 From d6955b089e834f6d13deccb458ef7732a2643209 Mon Sep 17 00:00:00 2001 From: Mathias Vorreiter Pedersen Date: Wed, 11 Feb 2026 20:52:08 +0000 Subject: [PATCH 03/38] C++: Fix Copilot comments. --- c/cert/test/rules/INT34-C/test.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/c/cert/test/rules/INT34-C/test.c b/c/cert/test/rules/INT34-C/test.c index 6248f75313..a50974ccd7 100644 --- a/c/cert/test/rules/INT34-C/test.c +++ b/c/cert/test/rules/INT34-C/test.c @@ -357,8 +357,8 @@ int main() { lhs12 << rhs11; // COMPLIANT: lhs12's precision is strictly greater than rhs11 lhs12 << rhs12; // NON_COMPLIANT: lhs12's precision is not strictly greater // than rhs12's - lhs12 << rhs13; // COMPLIANT[FALSE POSITIVE]: lhs12's precision is strictly greater than rhs13 (FP because range analysis reduced precision for performance reasons) - lhs12 << rhs14; // COMPLIANT[FALSE POSITIVE]: lhs12's precision is strictly greater than rhs14 (FP because range analysis reduced precision for performance reasons) + lhs12 << rhs13; // COMPLIANT[FALSE_POSITIVE]: lhs12's precision is strictly greater than rhs13 (FP because range analysis reduced precision for performance reasons) + lhs12 << rhs14; // COMPLIANT[FALSE_POSITIVE]: lhs12's precision is strictly greater than rhs14 (FP because range analysis reduced precision for performance reasons) lhs13 << rhs0; // COMPLIANT: lhs13's precision is strictly greater than rhs0 lhs13 << rhs1; // COMPLIANT: lhs13's precision is strictly greater than rhs1 lhs13 << rhs2; // COMPLIANT: lhs13's precision is strictly greater than rhs2 @@ -1893,8 +1893,8 @@ int main() { lhs12 >> rhs11; // COMPLIANT: lhs12's precision is strictly greater than rhs11 lhs12 >> rhs12; // NON_COMPLIANT: lhs12's precision is not strictly greater // than rhs12 - lhs12 >> rhs13; // COMPLIANT[FALSE POSITIVE]: lhs12's precision is strictly greater than rhs13 (FP because range analysis reduced precision for performance reasons) - lhs12 >> rhs14; // COMPLIANT[FALSE POSITIVE]: lhs12's precision is strictly greater than rhs14 (FP because range analysis reduced precision for performance reasons) + lhs12 >> rhs13; // COMPLIANT[FALSE_POSITIVE]: lhs12's precision is strictly greater than rhs13 (FP because range analysis reduced precision for performance reasons) + lhs12 >> rhs14; // COMPLIANT[FALSE_POSITIVE]: lhs12's precision is strictly greater than rhs14 (FP because range analysis reduced precision for performance reasons) lhs13 >> rhs0; // COMPLIANT: lhs13's precision is strictly greater than rhs0 lhs13 >> rhs1; // COMPLIANT: lhs13's precision is strictly greater than rhs1 lhs13 >> rhs2; // COMPLIANT: lhs13's precision is strictly greater than rhs2 From 115639d8487f7ecbe915b99e68eea62b5a0c6312 Mon Sep 17 00:00:00 2001 From: Simon Friis Vindum Date: Mon, 16 Feb 2026 14:20:14 +0100 Subject: [PATCH 04/38] Revert "C++: Accept test changes after github/codeql#21313." This reverts commit 141d5be42766520b4a993711e3f660a1494b458b. --- ...NegativeOrGreaterPrecisionOperand.expected | 112 ++++++++---------- c/cert/test/rules/INT34-C/test.c | 8 +- 2 files changed, 56 insertions(+), 64 deletions(-) diff --git a/c/cert/test/rules/INT34-C/ExprShiftedbyNegativeOrGreaterPrecisionOperand.expected b/c/cert/test/rules/INT34-C/ExprShiftedbyNegativeOrGreaterPrecisionOperand.expected index ca73e82c1d..dc92d0f1be 100644 --- a/c/cert/test/rules/INT34-C/ExprShiftedbyNegativeOrGreaterPrecisionOperand.expected +++ b/c/cert/test/rules/INT34-C/ExprShiftedbyNegativeOrGreaterPrecisionOperand.expected @@ -8,9 +8,9 @@ | test.c:59:3:59:14 | ... << ... | The operand 'lhs0' is shifted by an expression 'rhs9' whose upper bound (32) is greater than or equal to the precision. | | test.c:61:3:61:15 | ... << ... | The operand 'lhs0' is shifted by an expression 'rhs10' whose upper bound (31) is greater than or equal to the precision. | | test.c:63:3:63:15 | ... << ... | The operand 'lhs0' is shifted by an expression 'rhs11' whose upper bound (31) is greater than or equal to the precision. | -| test.c:65:3:65:15 | ... << ... | The operand 'lhs0' is shifted by an expression 'rhs12' whose upper bound (127) is greater than or equal to the precision. | -| test.c:67:3:67:15 | ... << ... | The operand 'lhs0' is shifted by an expression 'rhs13' whose upper bound (127) is greater than or equal to the precision. | -| test.c:69:3:69:15 | ... << ... | The operand 'lhs0' is shifted by an expression 'rhs14' whose upper bound (127) is greater than or equal to the precision. | +| test.c:65:3:65:15 | ... << ... | The operand 'lhs0' is shifted by an expression 'rhs12' whose upper bound (64) is greater than or equal to the precision. | +| test.c:67:3:67:15 | ... << ... | The operand 'lhs0' is shifted by an expression 'rhs13' whose upper bound (63) is greater than or equal to the precision. | +| test.c:69:3:69:15 | ... << ... | The operand 'lhs0' is shifted by an expression 'rhs14' whose upper bound (63) is greater than or equal to the precision. | | test.c:71:3:71:14 | ... << ... | The operand 'lhs1' is shifted by an expression 'rhs0' whose upper bound (8) is greater than or equal to the precision. | | test.c:73:3:73:14 | ... << ... | The operand 'lhs1' is shifted by an expression 'rhs1' whose upper bound (7) is greater than or equal to the precision. | | test.c:75:3:75:14 | ... << ... | The operand 'lhs1' is shifted by an expression 'rhs2' whose upper bound (7) is greater than or equal to the precision. | @@ -23,9 +23,9 @@ | test.c:89:3:89:14 | ... << ... | The operand 'lhs1' is shifted by an expression 'rhs9' whose upper bound (32) is greater than or equal to the precision. | | test.c:91:3:91:15 | ... << ... | The operand 'lhs1' is shifted by an expression 'rhs10' whose upper bound (31) is greater than or equal to the precision. | | test.c:93:3:93:15 | ... << ... | The operand 'lhs1' is shifted by an expression 'rhs11' whose upper bound (31) is greater than or equal to the precision. | -| test.c:95:3:95:15 | ... << ... | The operand 'lhs1' is shifted by an expression 'rhs12' whose upper bound (127) is greater than or equal to the precision. | -| test.c:97:3:97:15 | ... << ... | The operand 'lhs1' is shifted by an expression 'rhs13' whose upper bound (127) is greater than or equal to the precision. | -| test.c:99:3:99:15 | ... << ... | The operand 'lhs1' is shifted by an expression 'rhs14' whose upper bound (127) is greater than or equal to the precision. | +| test.c:95:3:95:15 | ... << ... | The operand 'lhs1' is shifted by an expression 'rhs12' whose upper bound (64) is greater than or equal to the precision. | +| test.c:97:3:97:15 | ... << ... | The operand 'lhs1' is shifted by an expression 'rhs13' whose upper bound (63) is greater than or equal to the precision. | +| test.c:99:3:99:15 | ... << ... | The operand 'lhs1' is shifted by an expression 'rhs14' whose upper bound (63) is greater than or equal to the precision. | | test.c:134:3:134:14 | ... << ... | The operand 'lhs3' is shifted by an expression 'rhs3' whose upper bound (16) is greater than or equal to the precision. | | test.c:138:3:138:14 | ... << ... | The operand 'lhs3' is shifted by an expression 'rhs6' whose upper bound (32) is greater than or equal to the precision. | | test.c:140:3:140:14 | ... << ... | The operand 'lhs3' is shifted by an expression 'rhs7' whose upper bound (31) is greater than or equal to the precision. | @@ -33,9 +33,9 @@ | test.c:144:3:144:14 | ... << ... | The operand 'lhs3' is shifted by an expression 'rhs9' whose upper bound (32) is greater than or equal to the precision. | | test.c:146:3:146:15 | ... << ... | The operand 'lhs3' is shifted by an expression 'rhs10' whose upper bound (31) is greater than or equal to the precision. | | test.c:148:3:148:15 | ... << ... | The operand 'lhs3' is shifted by an expression 'rhs11' whose upper bound (31) is greater than or equal to the precision. | -| test.c:150:3:150:15 | ... << ... | The operand 'lhs3' is shifted by an expression 'rhs12' whose upper bound (127) is greater than or equal to the precision. | -| test.c:152:3:152:15 | ... << ... | The operand 'lhs3' is shifted by an expression 'rhs13' whose upper bound (127) is greater than or equal to the precision. | -| test.c:154:3:154:15 | ... << ... | The operand 'lhs3' is shifted by an expression 'rhs14' whose upper bound (127) is greater than or equal to the precision. | +| test.c:150:3:150:15 | ... << ... | The operand 'lhs3' is shifted by an expression 'rhs12' whose upper bound (64) is greater than or equal to the precision. | +| test.c:152:3:152:15 | ... << ... | The operand 'lhs3' is shifted by an expression 'rhs13' whose upper bound (63) is greater than or equal to the precision. | +| test.c:154:3:154:15 | ... << ... | The operand 'lhs3' is shifted by an expression 'rhs14' whose upper bound (63) is greater than or equal to the precision. | | test.c:159:3:159:14 | ... << ... | The operand 'lhs4' is shifted by an expression 'rhs3' whose upper bound (16) is greater than or equal to the precision. | | test.c:161:3:161:14 | ... << ... | The operand 'lhs4' is shifted by an expression 'rhs4' whose upper bound (15) is greater than or equal to the precision. | | test.c:163:3:163:14 | ... << ... | The operand 'lhs4' is shifted by an expression 'rhs5' whose upper bound (15) is greater than or equal to the precision. | @@ -45,35 +45,31 @@ | test.c:171:3:171:14 | ... << ... | The operand 'lhs4' is shifted by an expression 'rhs9' whose upper bound (32) is greater than or equal to the precision. | | test.c:173:3:173:15 | ... << ... | The operand 'lhs4' is shifted by an expression 'rhs10' whose upper bound (31) is greater than or equal to the precision. | | test.c:175:3:175:15 | ... << ... | The operand 'lhs4' is shifted by an expression 'rhs11' whose upper bound (31) is greater than or equal to the precision. | -| test.c:177:3:177:15 | ... << ... | The operand 'lhs4' is shifted by an expression 'rhs12' whose upper bound (127) is greater than or equal to the precision. | -| test.c:179:3:179:15 | ... << ... | The operand 'lhs4' is shifted by an expression 'rhs13' whose upper bound (127) is greater than or equal to the precision. | -| test.c:181:3:181:15 | ... << ... | The operand 'lhs4' is shifted by an expression 'rhs14' whose upper bound (127) is greater than or equal to the precision. | +| test.c:177:3:177:15 | ... << ... | The operand 'lhs4' is shifted by an expression 'rhs12' whose upper bound (64) is greater than or equal to the precision. | +| test.c:179:3:179:15 | ... << ... | The operand 'lhs4' is shifted by an expression 'rhs13' whose upper bound (63) is greater than or equal to the precision. | +| test.c:181:3:181:15 | ... << ... | The operand 'lhs4' is shifted by an expression 'rhs14' whose upper bound (63) is greater than or equal to the precision. | | test.c:216:3:216:14 | ... << ... | The operand 'lhs6' is shifted by an expression 'rhs6' whose upper bound (32) is greater than or equal to the precision. | | test.c:220:3:220:14 | ... << ... | The operand 'lhs6' is shifted by an expression 'rhs9' whose upper bound (32) is greater than or equal to the precision. | -| test.c:224:3:224:15 | ... << ... | The operand 'lhs6' is shifted by an expression 'rhs12' whose upper bound (127) is greater than or equal to the precision. | -| test.c:226:3:226:15 | ... << ... | The operand 'lhs6' is shifted by an expression 'rhs13' whose upper bound (127) is greater than or equal to the precision. | -| test.c:228:3:228:15 | ... << ... | The operand 'lhs6' is shifted by an expression 'rhs14' whose upper bound (127) is greater than or equal to the precision. | +| test.c:224:3:224:15 | ... << ... | The operand 'lhs6' is shifted by an expression 'rhs12' whose upper bound (64) is greater than or equal to the precision. | +| test.c:226:3:226:15 | ... << ... | The operand 'lhs6' is shifted by an expression 'rhs13' whose upper bound (63) is greater than or equal to the precision. | +| test.c:228:3:228:15 | ... << ... | The operand 'lhs6' is shifted by an expression 'rhs14' whose upper bound (63) is greater than or equal to the precision. | | test.c:236:3:236:14 | ... << ... | The operand 'lhs7' is shifted by an expression 'rhs6' whose upper bound (32) is greater than or equal to the precision. | | test.c:238:3:238:14 | ... << ... | The operand 'lhs7' is shifted by an expression 'rhs7' whose upper bound (31) is greater than or equal to the precision. | | test.c:240:3:240:14 | ... << ... | The operand 'lhs7' is shifted by an expression 'rhs8' whose upper bound (31) is greater than or equal to the precision. | | test.c:242:3:242:14 | ... << ... | The operand 'lhs7' is shifted by an expression 'rhs9' whose upper bound (32) is greater than or equal to the precision. | | test.c:244:3:244:15 | ... << ... | The operand 'lhs7' is shifted by an expression 'rhs10' whose upper bound (31) is greater than or equal to the precision. | | test.c:246:3:246:15 | ... << ... | The operand 'lhs7' is shifted by an expression 'rhs11' whose upper bound (31) is greater than or equal to the precision. | -| test.c:248:3:248:15 | ... << ... | The operand 'lhs7' is shifted by an expression 'rhs12' whose upper bound (127) is greater than or equal to the precision. | -| test.c:250:3:250:15 | ... << ... | The operand 'lhs7' is shifted by an expression 'rhs13' whose upper bound (127) is greater than or equal to the precision. | -| test.c:252:3:252:15 | ... << ... | The operand 'lhs7' is shifted by an expression 'rhs14' whose upper bound (127) is greater than or equal to the precision. | -| test.c:292:3:292:15 | ... << ... | The operand 'lhs9' is shifted by an expression 'rhs12' whose upper bound (127) is greater than or equal to the precision. | -| test.c:294:3:294:15 | ... << ... | The operand 'lhs9' is shifted by an expression 'rhs13' whose upper bound (127) is greater than or equal to the precision. | -| test.c:296:3:296:15 | ... << ... | The operand 'lhs9' is shifted by an expression 'rhs14' whose upper bound (127) is greater than or equal to the precision. | -| test.c:316:3:316:16 | ... << ... | The operand 'lhs10' is shifted by an expression 'rhs12' whose upper bound (127) is greater than or equal to the precision. | -| test.c:318:3:318:16 | ... << ... | The operand 'lhs10' is shifted by an expression 'rhs13' whose upper bound (127) is greater than or equal to the precision. | -| test.c:320:3:320:16 | ... << ... | The operand 'lhs10' is shifted by an expression 'rhs14' whose upper bound (127) is greater than or equal to the precision. | -| test.c:358:3:358:16 | ... << ... | The operand 'lhs12' is shifted by an expression 'rhs12' whose upper bound (127) is greater than or equal to the precision. | -| test.c:360:3:360:16 | ... << ... | The operand 'lhs12' is shifted by an expression 'rhs13' whose upper bound (127) is greater than or equal to the precision. | -| test.c:361:3:361:16 | ... << ... | The operand 'lhs12' is shifted by an expression 'rhs14' whose upper bound (127) is greater than or equal to the precision. | -| test.c:374:3:374:16 | ... << ... | The operand 'lhs13' is shifted by an expression 'rhs12' whose upper bound (127) is greater than or equal to the precision. | -| test.c:376:3:376:16 | ... << ... | The operand 'lhs13' is shifted by an expression 'rhs13' whose upper bound (127) is greater than or equal to the precision. | -| test.c:378:3:378:16 | ... << ... | The operand 'lhs13' is shifted by an expression 'rhs14' whose upper bound (127) is greater than or equal to the precision. | +| test.c:248:3:248:15 | ... << ... | The operand 'lhs7' is shifted by an expression 'rhs12' whose upper bound (64) is greater than or equal to the precision. | +| test.c:250:3:250:15 | ... << ... | The operand 'lhs7' is shifted by an expression 'rhs13' whose upper bound (63) is greater than or equal to the precision. | +| test.c:252:3:252:15 | ... << ... | The operand 'lhs7' is shifted by an expression 'rhs14' whose upper bound (63) is greater than or equal to the precision. | +| test.c:292:3:292:15 | ... << ... | The operand 'lhs9' is shifted by an expression 'rhs12' whose upper bound (64) is greater than or equal to the precision. | +| test.c:316:3:316:16 | ... << ... | The operand 'lhs10' is shifted by an expression 'rhs12' whose upper bound (64) is greater than or equal to the precision. | +| test.c:318:3:318:16 | ... << ... | The operand 'lhs10' is shifted by an expression 'rhs13' whose upper bound (63) is greater than or equal to the precision. | +| test.c:320:3:320:16 | ... << ... | The operand 'lhs10' is shifted by an expression 'rhs14' whose upper bound (63) is greater than or equal to the precision. | +| test.c:358:3:358:16 | ... << ... | The operand 'lhs12' is shifted by an expression 'rhs12' whose upper bound (64) is greater than or equal to the precision. | +| test.c:374:3:374:16 | ... << ... | The operand 'lhs13' is shifted by an expression 'rhs12' whose upper bound (64) is greater than or equal to the precision. | +| test.c:376:3:376:16 | ... << ... | The operand 'lhs13' is shifted by an expression 'rhs13' whose upper bound (63) is greater than or equal to the precision. | +| test.c:378:3:378:16 | ... << ... | The operand 'lhs13' is shifted by an expression 'rhs14' whose upper bound (63) is greater than or equal to the precision. | | test.c:1579:3:1580:10 | ... >> ... | The operand 'lhs0' is shifted by an expression 'rhs0' whose upper bound (8) is greater than or equal to the precision. | | test.c:1583:3:1584:10 | ... >> ... | The operand 'lhs0' is shifted by an expression 'rhs3' whose upper bound (16) is greater than or equal to the precision. | | test.c:1585:3:1586:10 | ... >> ... | The operand 'lhs0' is shifted by an expression 'rhs4' whose upper bound (15) is greater than or equal to the precision. | @@ -84,9 +80,9 @@ | test.c:1595:3:1596:10 | ... >> ... | The operand 'lhs0' is shifted by an expression 'rhs9' whose upper bound (32) is greater than or equal to the precision. | | test.c:1597:3:1597:15 | ... >> ... | The operand 'lhs0' is shifted by an expression 'rhs10' whose upper bound (31) is greater than or equal to the precision. | | test.c:1599:3:1599:15 | ... >> ... | The operand 'lhs0' is shifted by an expression 'rhs11' whose upper bound (31) is greater than or equal to the precision. | -| test.c:1601:3:1601:15 | ... >> ... | The operand 'lhs0' is shifted by an expression 'rhs12' whose upper bound (127) is greater than or equal to the precision. | -| test.c:1603:3:1603:15 | ... >> ... | The operand 'lhs0' is shifted by an expression 'rhs13' whose upper bound (127) is greater than or equal to the precision. | -| test.c:1605:3:1605:15 | ... >> ... | The operand 'lhs0' is shifted by an expression 'rhs14' whose upper bound (127) is greater than or equal to the precision. | +| test.c:1601:3:1601:15 | ... >> ... | The operand 'lhs0' is shifted by an expression 'rhs12' whose upper bound (64) is greater than or equal to the precision. | +| test.c:1603:3:1603:15 | ... >> ... | The operand 'lhs0' is shifted by an expression 'rhs13' whose upper bound (63) is greater than or equal to the precision. | +| test.c:1605:3:1605:15 | ... >> ... | The operand 'lhs0' is shifted by an expression 'rhs14' whose upper bound (63) is greater than or equal to the precision. | | test.c:1607:3:1608:10 | ... >> ... | The operand 'lhs1' is shifted by an expression 'rhs0' whose upper bound (8) is greater than or equal to the precision. | | test.c:1609:3:1610:10 | ... >> ... | The operand 'lhs1' is shifted by an expression 'rhs1' whose upper bound (7) is greater than or equal to the precision. | | test.c:1611:3:1612:10 | ... >> ... | The operand 'lhs1' is shifted by an expression 'rhs2' whose upper bound (7) is greater than or equal to the precision. | @@ -99,9 +95,9 @@ | test.c:1625:3:1626:10 | ... >> ... | The operand 'lhs1' is shifted by an expression 'rhs9' whose upper bound (32) is greater than or equal to the precision. | | test.c:1627:3:1627:15 | ... >> ... | The operand 'lhs1' is shifted by an expression 'rhs10' whose upper bound (31) is greater than or equal to the precision. | | test.c:1629:3:1629:15 | ... >> ... | The operand 'lhs1' is shifted by an expression 'rhs11' whose upper bound (31) is greater than or equal to the precision. | -| test.c:1631:3:1631:15 | ... >> ... | The operand 'lhs1' is shifted by an expression 'rhs12' whose upper bound (127) is greater than or equal to the precision. | -| test.c:1633:3:1633:15 | ... >> ... | The operand 'lhs1' is shifted by an expression 'rhs13' whose upper bound (127) is greater than or equal to the precision. | -| test.c:1635:3:1635:15 | ... >> ... | The operand 'lhs1' is shifted by an expression 'rhs14' whose upper bound (127) is greater than or equal to the precision. | +| test.c:1631:3:1631:15 | ... >> ... | The operand 'lhs1' is shifted by an expression 'rhs12' whose upper bound (64) is greater than or equal to the precision. | +| test.c:1633:3:1633:15 | ... >> ... | The operand 'lhs1' is shifted by an expression 'rhs13' whose upper bound (63) is greater than or equal to the precision. | +| test.c:1635:3:1635:15 | ... >> ... | The operand 'lhs1' is shifted by an expression 'rhs14' whose upper bound (63) is greater than or equal to the precision. | | test.c:1670:3:1671:10 | ... >> ... | The operand 'lhs3' is shifted by an expression 'rhs3' whose upper bound (16) is greater than or equal to the precision. | | test.c:1674:3:1675:10 | ... >> ... | The operand 'lhs3' is shifted by an expression 'rhs6' whose upper bound (32) is greater than or equal to the precision. | | test.c:1676:3:1677:10 | ... >> ... | The operand 'lhs3' is shifted by an expression 'rhs7' whose upper bound (31) is greater than or equal to the precision. | @@ -109,9 +105,9 @@ | test.c:1680:3:1681:10 | ... >> ... | The operand 'lhs3' is shifted by an expression 'rhs9' whose upper bound (32) is greater than or equal to the precision. | | test.c:1682:3:1682:15 | ... >> ... | The operand 'lhs3' is shifted by an expression 'rhs10' whose upper bound (31) is greater than or equal to the precision. | | test.c:1684:3:1684:15 | ... >> ... | The operand 'lhs3' is shifted by an expression 'rhs11' whose upper bound (31) is greater than or equal to the precision. | -| test.c:1686:3:1686:15 | ... >> ... | The operand 'lhs3' is shifted by an expression 'rhs12' whose upper bound (127) is greater than or equal to the precision. | -| test.c:1688:3:1688:15 | ... >> ... | The operand 'lhs3' is shifted by an expression 'rhs13' whose upper bound (127) is greater than or equal to the precision. | -| test.c:1690:3:1690:15 | ... >> ... | The operand 'lhs3' is shifted by an expression 'rhs14' whose upper bound (127) is greater than or equal to the precision. | +| test.c:1686:3:1686:15 | ... >> ... | The operand 'lhs3' is shifted by an expression 'rhs12' whose upper bound (64) is greater than or equal to the precision. | +| test.c:1688:3:1688:15 | ... >> ... | The operand 'lhs3' is shifted by an expression 'rhs13' whose upper bound (63) is greater than or equal to the precision. | +| test.c:1690:3:1690:15 | ... >> ... | The operand 'lhs3' is shifted by an expression 'rhs14' whose upper bound (63) is greater than or equal to the precision. | | test.c:1695:3:1696:10 | ... >> ... | The operand 'lhs4' is shifted by an expression 'rhs3' whose upper bound (16) is greater than or equal to the precision. | | test.c:1697:3:1698:10 | ... >> ... | The operand 'lhs4' is shifted by an expression 'rhs4' whose upper bound (15) is greater than or equal to the precision. | | test.c:1699:3:1700:10 | ... >> ... | The operand 'lhs4' is shifted by an expression 'rhs5' whose upper bound (15) is greater than or equal to the precision. | @@ -121,35 +117,31 @@ | test.c:1707:3:1708:10 | ... >> ... | The operand 'lhs4' is shifted by an expression 'rhs9' whose upper bound (32) is greater than or equal to the precision. | | test.c:1709:3:1709:15 | ... >> ... | The operand 'lhs4' is shifted by an expression 'rhs10' whose upper bound (31) is greater than or equal to the precision. | | test.c:1711:3:1711:15 | ... >> ... | The operand 'lhs4' is shifted by an expression 'rhs11' whose upper bound (31) is greater than or equal to the precision. | -| test.c:1713:3:1713:15 | ... >> ... | The operand 'lhs4' is shifted by an expression 'rhs12' whose upper bound (127) is greater than or equal to the precision. | -| test.c:1715:3:1715:15 | ... >> ... | The operand 'lhs4' is shifted by an expression 'rhs13' whose upper bound (127) is greater than or equal to the precision. | -| test.c:1717:3:1717:15 | ... >> ... | The operand 'lhs4' is shifted by an expression 'rhs14' whose upper bound (127) is greater than or equal to the precision. | +| test.c:1713:3:1713:15 | ... >> ... | The operand 'lhs4' is shifted by an expression 'rhs12' whose upper bound (64) is greater than or equal to the precision. | +| test.c:1715:3:1715:15 | ... >> ... | The operand 'lhs4' is shifted by an expression 'rhs13' whose upper bound (63) is greater than or equal to the precision. | +| test.c:1717:3:1717:15 | ... >> ... | The operand 'lhs4' is shifted by an expression 'rhs14' whose upper bound (63) is greater than or equal to the precision. | | test.c:1752:3:1753:10 | ... >> ... | The operand 'lhs6' is shifted by an expression 'rhs6' whose upper bound (32) is greater than or equal to the precision. | | test.c:1756:3:1757:10 | ... >> ... | The operand 'lhs6' is shifted by an expression 'rhs9' whose upper bound (32) is greater than or equal to the precision. | -| test.c:1760:3:1760:15 | ... >> ... | The operand 'lhs6' is shifted by an expression 'rhs12' whose upper bound (127) is greater than or equal to the precision. | -| test.c:1762:3:1762:15 | ... >> ... | The operand 'lhs6' is shifted by an expression 'rhs13' whose upper bound (127) is greater than or equal to the precision. | -| test.c:1764:3:1764:15 | ... >> ... | The operand 'lhs6' is shifted by an expression 'rhs14' whose upper bound (127) is greater than or equal to the precision. | +| test.c:1760:3:1760:15 | ... >> ... | The operand 'lhs6' is shifted by an expression 'rhs12' whose upper bound (64) is greater than or equal to the precision. | +| test.c:1762:3:1762:15 | ... >> ... | The operand 'lhs6' is shifted by an expression 'rhs13' whose upper bound (63) is greater than or equal to the precision. | +| test.c:1764:3:1764:15 | ... >> ... | The operand 'lhs6' is shifted by an expression 'rhs14' whose upper bound (63) is greater than or equal to the precision. | | test.c:1772:3:1773:10 | ... >> ... | The operand 'lhs7' is shifted by an expression 'rhs6' whose upper bound (32) is greater than or equal to the precision. | | test.c:1774:3:1775:10 | ... >> ... | The operand 'lhs7' is shifted by an expression 'rhs7' whose upper bound (31) is greater than or equal to the precision. | | test.c:1776:3:1777:10 | ... >> ... | The operand 'lhs7' is shifted by an expression 'rhs8' whose upper bound (31) is greater than or equal to the precision. | | test.c:1778:3:1779:10 | ... >> ... | The operand 'lhs7' is shifted by an expression 'rhs9' whose upper bound (32) is greater than or equal to the precision. | | test.c:1780:3:1780:15 | ... >> ... | The operand 'lhs7' is shifted by an expression 'rhs10' whose upper bound (31) is greater than or equal to the precision. | | test.c:1782:3:1782:15 | ... >> ... | The operand 'lhs7' is shifted by an expression 'rhs11' whose upper bound (31) is greater than or equal to the precision. | -| test.c:1784:3:1784:15 | ... >> ... | The operand 'lhs7' is shifted by an expression 'rhs12' whose upper bound (127) is greater than or equal to the precision. | -| test.c:1786:3:1786:15 | ... >> ... | The operand 'lhs7' is shifted by an expression 'rhs13' whose upper bound (127) is greater than or equal to the precision. | -| test.c:1788:3:1788:15 | ... >> ... | The operand 'lhs7' is shifted by an expression 'rhs14' whose upper bound (127) is greater than or equal to the precision. | -| test.c:1828:3:1828:15 | ... >> ... | The operand 'lhs9' is shifted by an expression 'rhs12' whose upper bound (127) is greater than or equal to the precision. | -| test.c:1830:3:1830:15 | ... >> ... | The operand 'lhs9' is shifted by an expression 'rhs13' whose upper bound (127) is greater than or equal to the precision. | -| test.c:1832:3:1832:15 | ... >> ... | The operand 'lhs9' is shifted by an expression 'rhs14' whose upper bound (127) is greater than or equal to the precision. | -| test.c:1852:3:1852:16 | ... >> ... | The operand 'lhs10' is shifted by an expression 'rhs12' whose upper bound (127) is greater than or equal to the precision. | -| test.c:1854:3:1854:16 | ... >> ... | The operand 'lhs10' is shifted by an expression 'rhs13' whose upper bound (127) is greater than or equal to the precision. | -| test.c:1856:3:1856:16 | ... >> ... | The operand 'lhs10' is shifted by an expression 'rhs14' whose upper bound (127) is greater than or equal to the precision. | -| test.c:1894:3:1894:16 | ... >> ... | The operand 'lhs12' is shifted by an expression 'rhs12' whose upper bound (127) is greater than or equal to the precision. | -| test.c:1896:3:1896:16 | ... >> ... | The operand 'lhs12' is shifted by an expression 'rhs13' whose upper bound (127) is greater than or equal to the precision. | -| test.c:1897:3:1897:16 | ... >> ... | The operand 'lhs12' is shifted by an expression 'rhs14' whose upper bound (127) is greater than or equal to the precision. | -| test.c:1910:3:1910:16 | ... >> ... | The operand 'lhs13' is shifted by an expression 'rhs12' whose upper bound (127) is greater than or equal to the precision. | -| test.c:1912:3:1912:16 | ... >> ... | The operand 'lhs13' is shifted by an expression 'rhs13' whose upper bound (127) is greater than or equal to the precision. | -| test.c:1914:3:1914:16 | ... >> ... | The operand 'lhs13' is shifted by an expression 'rhs14' whose upper bound (127) is greater than or equal to the precision. | +| test.c:1784:3:1784:15 | ... >> ... | The operand 'lhs7' is shifted by an expression 'rhs12' whose upper bound (64) is greater than or equal to the precision. | +| test.c:1786:3:1786:15 | ... >> ... | The operand 'lhs7' is shifted by an expression 'rhs13' whose upper bound (63) is greater than or equal to the precision. | +| test.c:1788:3:1788:15 | ... >> ... | The operand 'lhs7' is shifted by an expression 'rhs14' whose upper bound (63) is greater than or equal to the precision. | +| test.c:1828:3:1828:15 | ... >> ... | The operand 'lhs9' is shifted by an expression 'rhs12' whose upper bound (64) is greater than or equal to the precision. | +| test.c:1852:3:1852:16 | ... >> ... | The operand 'lhs10' is shifted by an expression 'rhs12' whose upper bound (64) is greater than or equal to the precision. | +| test.c:1854:3:1854:16 | ... >> ... | The operand 'lhs10' is shifted by an expression 'rhs13' whose upper bound (63) is greater than or equal to the precision. | +| test.c:1856:3:1856:16 | ... >> ... | The operand 'lhs10' is shifted by an expression 'rhs14' whose upper bound (63) is greater than or equal to the precision. | +| test.c:1894:3:1894:16 | ... >> ... | The operand 'lhs12' is shifted by an expression 'rhs12' whose upper bound (64) is greater than or equal to the precision. | +| test.c:1910:3:1910:16 | ... >> ... | The operand 'lhs13' is shifted by an expression 'rhs12' whose upper bound (64) is greater than or equal to the precision. | +| test.c:1912:3:1912:16 | ... >> ... | The operand 'lhs13' is shifted by an expression 'rhs13' whose upper bound (63) is greater than or equal to the precision. | +| test.c:1914:3:1914:16 | ... >> ... | The operand 'lhs13' is shifted by an expression 'rhs14' whose upper bound (63) is greater than or equal to the precision. | | test.c:3115:3:3115:12 | ... << ... | The operand 'lhs0' is shifted by an expression '- ...' which may be negative. | | test.c:3116:3:3116:12 | ... << ... | The operand 'lhs1' is shifted by an expression '- ...' which may be negative. | | test.c:3117:3:3117:12 | ... << ... | The operand 'lhs2' is shifted by an expression '- ...' which may be negative. | diff --git a/c/cert/test/rules/INT34-C/test.c b/c/cert/test/rules/INT34-C/test.c index a50974ccd7..c47df4b55d 100644 --- a/c/cert/test/rules/INT34-C/test.c +++ b/c/cert/test/rules/INT34-C/test.c @@ -357,8 +357,8 @@ int main() { lhs12 << rhs11; // COMPLIANT: lhs12's precision is strictly greater than rhs11 lhs12 << rhs12; // NON_COMPLIANT: lhs12's precision is not strictly greater // than rhs12's - lhs12 << rhs13; // COMPLIANT[FALSE_POSITIVE]: lhs12's precision is strictly greater than rhs13 (FP because range analysis reduced precision for performance reasons) - lhs12 << rhs14; // COMPLIANT[FALSE_POSITIVE]: lhs12's precision is strictly greater than rhs14 (FP because range analysis reduced precision for performance reasons) + lhs12 << rhs13; // COMPLIANT: lhs12's precision is strictly greater than rhs13 + lhs12 << rhs14; // COMPLIANT: lhs12's precision is strictly greater than rhs14 lhs13 << rhs0; // COMPLIANT: lhs13's precision is strictly greater than rhs0 lhs13 << rhs1; // COMPLIANT: lhs13's precision is strictly greater than rhs1 lhs13 << rhs2; // COMPLIANT: lhs13's precision is strictly greater than rhs2 @@ -1893,8 +1893,8 @@ int main() { lhs12 >> rhs11; // COMPLIANT: lhs12's precision is strictly greater than rhs11 lhs12 >> rhs12; // NON_COMPLIANT: lhs12's precision is not strictly greater // than rhs12 - lhs12 >> rhs13; // COMPLIANT[FALSE_POSITIVE]: lhs12's precision is strictly greater than rhs13 (FP because range analysis reduced precision for performance reasons) - lhs12 >> rhs14; // COMPLIANT[FALSE_POSITIVE]: lhs12's precision is strictly greater than rhs14 (FP because range analysis reduced precision for performance reasons) + lhs12 >> rhs13; // COMPLIANT: lhs12's precision is strictly greater than rhs13 + lhs12 >> rhs14; // COMPLIANT: lhs12's precision is strictly greater than rhs14 lhs13 >> rhs0; // COMPLIANT: lhs13's precision is strictly greater than rhs0 lhs13 >> rhs1; // COMPLIANT: lhs13's precision is strictly greater than rhs1 lhs13 >> rhs2; // COMPLIANT: lhs13's precision is strictly greater than rhs2 From 2da1be388874c562ec8499a1b1f6cfeeff2c0654 Mon Sep 17 00:00:00 2001 From: Jeroen Ketema Date: Tue, 17 Feb 2026 14:31:14 +0100 Subject: [PATCH 05/38] Update test expectations after switch to SoftFloat library in the extractor --- ...CorrectIntervalForDigitSequencesSeparators.expected | 10 +++++----- .../rules/M2-13-4/LiteralSuffixNotUpperCase.expected | 4 ++-- ...icitConstConversionToSmallerUnderlyingType.expected | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/cpp/autosar/test/rules/A13-6-1/UseCorrectIntervalForDigitSequencesSeparators.expected b/cpp/autosar/test/rules/A13-6-1/UseCorrectIntervalForDigitSequencesSeparators.expected index 9cda0967bf..ee87fca749 100644 --- a/cpp/autosar/test/rules/A13-6-1/UseCorrectIntervalForDigitSequencesSeparators.expected +++ b/cpp/autosar/test/rules/A13-6-1/UseCorrectIntervalForDigitSequencesSeparators.expected @@ -7,8 +7,8 @@ | test.cpp:19:3:19:17 | 1370 | The digit sequence 01010101'1010 uses a digit sequence separator at a spacing other than 4. | | test.cpp:20:3:20:15 | 85 | The digit sequence 01'01'01'01 uses a digit sequence separator at a spacing other than 4. | | test.cpp:21:3:21:14 | 85 | The digit sequence 010'1010'1 uses a digit sequence separator at a spacing other than 4. | -| test.cpp:26:3:26:15 | 11000000000.0 | The digit sequence 1000'000 uses a digit sequence separator at a spacing other than 3. | -| test.cpp:27:3:27:16 | 11000000000.0 | The digit sequence 10'00'000 uses a digit sequence separator at a spacing other than 3. | -| test.cpp:28:3:28:17 | 11000000000.0 | The digit sequence 1'0 uses a digit sequence separator at a spacing other than 3. | -| test.cpp:29:3:29:16 | 11000000000.0 | The digit sequence 10'000'00 uses a digit sequence separator at a spacing other than 3. | -| test.cpp:30:3:30:15 | 11000000000.0 | The digit sequence 1'0 uses a digit sequence separator at a spacing other than 3. | +| test.cpp:26:3:26:15 | 1.1E10 | The digit sequence 1000'000 uses a digit sequence separator at a spacing other than 3. | +| test.cpp:27:3:27:16 | 1.1E10 | The digit sequence 10'00'000 uses a digit sequence separator at a spacing other than 3. | +| test.cpp:28:3:28:17 | 1.1E10 | The digit sequence 1'0 uses a digit sequence separator at a spacing other than 3. | +| test.cpp:29:3:29:16 | 1.1E10 | The digit sequence 10'000'00 uses a digit sequence separator at a spacing other than 3. | +| test.cpp:30:3:30:15 | 1.1E10 | The digit sequence 1'0 uses a digit sequence separator at a spacing other than 3. | diff --git a/cpp/autosar/test/rules/M2-13-4/LiteralSuffixNotUpperCase.expected b/cpp/autosar/test/rules/M2-13-4/LiteralSuffixNotUpperCase.expected index 9397fbac49..66fa304117 100644 --- a/cpp/autosar/test/rules/M2-13-4/LiteralSuffixNotUpperCase.expected +++ b/cpp/autosar/test/rules/M2-13-4/LiteralSuffixNotUpperCase.expected @@ -8,5 +8,5 @@ | test.cpp:16:3:16:14 | 1254450 | Numeric literal 0x13'24'32Ul has the lower case suffix l. | | test.cpp:17:3:17:13 | 1254450 | Numeric literal 0x13'24'32u has the lower case suffix u. | | test.cpp:18:3:18:13 | 1254450 | Numeric literal 0x13'24'32l has the lower case suffix l. | -| test.cpp:22:3:22:15 | 1.123122995e+10 | Numeric literal 1.123'123e10f has the lower case suffix f. | -| test.cpp:23:3:23:15 | 11231230000.0 | Numeric literal 1.123'123e10l has the lower case suffix l. | +| test.cpp:22:3:22:15 | 1.123123E10 | Numeric literal 1.123'123e10f has the lower case suffix f. | +| test.cpp:23:3:23:15 | 1.123123E10 | Numeric literal 1.123'123e10l has the lower case suffix l. | diff --git a/cpp/autosar/test/rules/M5-0-6/ImplicitConstConversionToSmallerUnderlyingType.expected b/cpp/autosar/test/rules/M5-0-6/ImplicitConstConversionToSmallerUnderlyingType.expected index 6b1d701128..00e191758c 100644 --- a/cpp/autosar/test/rules/M5-0-6/ImplicitConstConversionToSmallerUnderlyingType.expected +++ b/cpp/autosar/test/rules/M5-0-6/ImplicitConstConversionToSmallerUnderlyingType.expected @@ -1,2 +1,2 @@ | test.cpp:11:8:11:10 | (int8_t)... | Implicit conversion of integral $@ reduces the size from 4 bytes to 1 bytes. | test.cpp:11:8:11:10 | 256 | 256 | -| test.cpp:24:9:24:14 | (float)... | Implicit conversion of floating point $@ reduces the size from 8 bytes to 4 bytes. | test.cpp:24:9:24:14 | 3.500000000000000016e+38 | 3.5e38 | +| test.cpp:24:9:24:14 | (float)... | Implicit conversion of floating point $@ reduces the size from 8 bytes to 4 bytes. | test.cpp:24:9:24:14 | 3.5E38 | 3.5e38 | From b88313953267bec0ff4c75418eaa3ee5ac97259c Mon Sep 17 00:00:00 2001 From: Jeroen Ketema Date: Tue, 24 Feb 2026 11:17:33 +0100 Subject: [PATCH 06/38] Revert "Merge pull request #1042 from jketema/jketema/softfloat" This reverts commit 3bc45b82c82530da40e8e2e94634b246c3c8840b, reversing changes made to 09d1e3a52798dcb89bace5de57d10b7e4fe5e535. --- ...CorrectIntervalForDigitSequencesSeparators.expected | 10 +++++----- .../rules/M2-13-4/LiteralSuffixNotUpperCase.expected | 4 ++-- ...icitConstConversionToSmallerUnderlyingType.expected | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/cpp/autosar/test/rules/A13-6-1/UseCorrectIntervalForDigitSequencesSeparators.expected b/cpp/autosar/test/rules/A13-6-1/UseCorrectIntervalForDigitSequencesSeparators.expected index ee87fca749..9cda0967bf 100644 --- a/cpp/autosar/test/rules/A13-6-1/UseCorrectIntervalForDigitSequencesSeparators.expected +++ b/cpp/autosar/test/rules/A13-6-1/UseCorrectIntervalForDigitSequencesSeparators.expected @@ -7,8 +7,8 @@ | test.cpp:19:3:19:17 | 1370 | The digit sequence 01010101'1010 uses a digit sequence separator at a spacing other than 4. | | test.cpp:20:3:20:15 | 85 | The digit sequence 01'01'01'01 uses a digit sequence separator at a spacing other than 4. | | test.cpp:21:3:21:14 | 85 | The digit sequence 010'1010'1 uses a digit sequence separator at a spacing other than 4. | -| test.cpp:26:3:26:15 | 1.1E10 | The digit sequence 1000'000 uses a digit sequence separator at a spacing other than 3. | -| test.cpp:27:3:27:16 | 1.1E10 | The digit sequence 10'00'000 uses a digit sequence separator at a spacing other than 3. | -| test.cpp:28:3:28:17 | 1.1E10 | The digit sequence 1'0 uses a digit sequence separator at a spacing other than 3. | -| test.cpp:29:3:29:16 | 1.1E10 | The digit sequence 10'000'00 uses a digit sequence separator at a spacing other than 3. | -| test.cpp:30:3:30:15 | 1.1E10 | The digit sequence 1'0 uses a digit sequence separator at a spacing other than 3. | +| test.cpp:26:3:26:15 | 11000000000.0 | The digit sequence 1000'000 uses a digit sequence separator at a spacing other than 3. | +| test.cpp:27:3:27:16 | 11000000000.0 | The digit sequence 10'00'000 uses a digit sequence separator at a spacing other than 3. | +| test.cpp:28:3:28:17 | 11000000000.0 | The digit sequence 1'0 uses a digit sequence separator at a spacing other than 3. | +| test.cpp:29:3:29:16 | 11000000000.0 | The digit sequence 10'000'00 uses a digit sequence separator at a spacing other than 3. | +| test.cpp:30:3:30:15 | 11000000000.0 | The digit sequence 1'0 uses a digit sequence separator at a spacing other than 3. | diff --git a/cpp/autosar/test/rules/M2-13-4/LiteralSuffixNotUpperCase.expected b/cpp/autosar/test/rules/M2-13-4/LiteralSuffixNotUpperCase.expected index 66fa304117..9397fbac49 100644 --- a/cpp/autosar/test/rules/M2-13-4/LiteralSuffixNotUpperCase.expected +++ b/cpp/autosar/test/rules/M2-13-4/LiteralSuffixNotUpperCase.expected @@ -8,5 +8,5 @@ | test.cpp:16:3:16:14 | 1254450 | Numeric literal 0x13'24'32Ul has the lower case suffix l. | | test.cpp:17:3:17:13 | 1254450 | Numeric literal 0x13'24'32u has the lower case suffix u. | | test.cpp:18:3:18:13 | 1254450 | Numeric literal 0x13'24'32l has the lower case suffix l. | -| test.cpp:22:3:22:15 | 1.123123E10 | Numeric literal 1.123'123e10f has the lower case suffix f. | -| test.cpp:23:3:23:15 | 1.123123E10 | Numeric literal 1.123'123e10l has the lower case suffix l. | +| test.cpp:22:3:22:15 | 1.123122995e+10 | Numeric literal 1.123'123e10f has the lower case suffix f. | +| test.cpp:23:3:23:15 | 11231230000.0 | Numeric literal 1.123'123e10l has the lower case suffix l. | diff --git a/cpp/autosar/test/rules/M5-0-6/ImplicitConstConversionToSmallerUnderlyingType.expected b/cpp/autosar/test/rules/M5-0-6/ImplicitConstConversionToSmallerUnderlyingType.expected index 00e191758c..6b1d701128 100644 --- a/cpp/autosar/test/rules/M5-0-6/ImplicitConstConversionToSmallerUnderlyingType.expected +++ b/cpp/autosar/test/rules/M5-0-6/ImplicitConstConversionToSmallerUnderlyingType.expected @@ -1,2 +1,2 @@ | test.cpp:11:8:11:10 | (int8_t)... | Implicit conversion of integral $@ reduces the size from 4 bytes to 1 bytes. | test.cpp:11:8:11:10 | 256 | 256 | -| test.cpp:24:9:24:14 | (float)... | Implicit conversion of floating point $@ reduces the size from 8 bytes to 4 bytes. | test.cpp:24:9:24:14 | 3.5E38 | 3.5e38 | +| test.cpp:24:9:24:14 | (float)... | Implicit conversion of floating point $@ reduces the size from 8 bytes to 4 bytes. | test.cpp:24:9:24:14 | 3.500000000000000016e+38 | 3.5e38 | From a7b10a1c472fed4db8858afd8dbc52e600ccfa24 Mon Sep 17 00:00:00 2001 From: Jeroen Ketema Date: Mon, 30 Mar 2026 15:09:13 +0200 Subject: [PATCH 07/38] Update expected test results --- .../codingstandards/cpp/identifiers/IdentifiersTest.expected | 2 +- .../test/rules/RULE-15-1-3/NonExplicitConversionMember.expected | 2 +- .../test/rules/RULE-19-2-2/InvalidIncludeDirective.expected | 1 + cpp/misra/test/rules/RULE-19-2-2/test.cpp | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/cpp/common/test/library/codingstandards/cpp/identifiers/IdentifiersTest.expected b/cpp/common/test/library/codingstandards/cpp/identifiers/IdentifiersTest.expected index 697666d61f..ab4c62a779 100644 --- a/cpp/common/test/library/codingstandards/cpp/identifiers/IdentifiersTest.expected +++ b/cpp/common/test/library/codingstandards/cpp/identifiers/IdentifiersTest.expected @@ -162,7 +162,7 @@ | test.cpp:244:7:244:27 | TemplateTemplateClass | test.cpp:244:7:244:27 | TemplateTemplateClass | | test.cpp:245:16:245:24 | container | test.cpp:245:16:245:24 | definition of container | | test.cpp:249:20:249:20 | T | test.cpp:249:20:249:20 | definition of T | -| test.cpp:249:53:249:53 | variable_template | test.cpp:249:53:249:53 | definition of variable_template | +| test.cpp:249:35:249:51 | variable_template | test.cpp:249:35:249:51 | definition of variable_template | | test.cpp:252:20:252:20 | T | test.cpp:252:20:252:20 | definition of T | | test.cpp:252:29:252:39 | VectorAlias | test.cpp:252:29:252:39 | definition of VectorAlias | | test.cpp:255:7:255:15 | BaseClass | test.cpp:255:7:255:15 | definition of BaseClass | diff --git a/cpp/misra/test/rules/RULE-15-1-3/NonExplicitConversionMember.expected b/cpp/misra/test/rules/RULE-15-1-3/NonExplicitConversionMember.expected index 9603aa1c2b..935b6a8156 100644 --- a/cpp/misra/test/rules/RULE-15-1-3/NonExplicitConversionMember.expected +++ b/cpp/misra/test/rules/RULE-15-1-3/NonExplicitConversionMember.expected @@ -1,5 +1,5 @@ | test.cpp:5:3:5:12 | TestClass1 | Constructor 'TestClass1' that is callable with a single argument shall be explicit. | -| test.cpp:6:3:6:23 | operator signed int | Conversion operator shall be explicit. | +| test.cpp:6:3:6:23 | operator int32_t | Conversion operator shall be explicit. | | test.cpp:23:3:23:12 | TestClass4 | Constructor 'TestClass4' that is callable with a single argument shall be explicit. | | test.cpp:25:3:25:12 | TestClass4 | Constructor 'TestClass4' that is callable with a single argument shall be explicit. | | test.cpp:44:3:44:17 | operator double | Conversion operator shall be explicit. | diff --git a/cpp/misra/test/rules/RULE-19-2-2/InvalidIncludeDirective.expected b/cpp/misra/test/rules/RULE-19-2-2/InvalidIncludeDirective.expected index 4e85513b0e..09261053ce 100644 --- a/cpp/misra/test/rules/RULE-19-2-2/InvalidIncludeDirective.expected +++ b/cpp/misra/test/rules/RULE-19-2-2/InvalidIncludeDirective.expected @@ -1,2 +1,3 @@ | test.cpp:6:1:6:20 | #include STRING_PATH | Non-compliant #include directive text 'STRING_PATH'. | +| test.cpp:8:1:8:17 | #include "string" ".h" | Non-compliant #include directive text '"string" ".h"'. | | test.cpp:10:1:10:16 | #include QSTRING | Non-compliant #include directive text 'QSTRING'. | diff --git a/cpp/misra/test/rules/RULE-19-2-2/test.cpp b/cpp/misra/test/rules/RULE-19-2-2/test.cpp index b1788458ec..058c4e8dfa 100644 --- a/cpp/misra/test/rules/RULE-19-2-2/test.cpp +++ b/cpp/misra/test/rules/RULE-19-2-2/test.cpp @@ -5,7 +5,7 @@ #include // COMPLIANT #include STRING_PATH // NON-COMPLIANT // clang-format off -#include "string" ".h" // NON-COMPLIANT[False negative] +#include "string" ".h" // NON-COMPLIANT // clang-format on #include QSTRING DOTH // NON-COMPLIANT From bfc504c1a916b51758f24b91569e962236151c66 Mon Sep 17 00:00:00 2001 From: Jeroen Ketema Date: Fri, 24 Apr 2026 15:13:56 +0200 Subject: [PATCH 08/38] Reapply "Merge pull request #1042 from jketema/jketema/softfloat" This reverts commit b88313953267bec0ff4c75418eaa3ee5ac97259c. --- ...CorrectIntervalForDigitSequencesSeparators.expected | 10 +++++----- .../rules/M2-13-4/LiteralSuffixNotUpperCase.expected | 4 ++-- ...icitConstConversionToSmallerUnderlyingType.expected | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/cpp/autosar/test/rules/A13-6-1/UseCorrectIntervalForDigitSequencesSeparators.expected b/cpp/autosar/test/rules/A13-6-1/UseCorrectIntervalForDigitSequencesSeparators.expected index 9cda0967bf..ee87fca749 100644 --- a/cpp/autosar/test/rules/A13-6-1/UseCorrectIntervalForDigitSequencesSeparators.expected +++ b/cpp/autosar/test/rules/A13-6-1/UseCorrectIntervalForDigitSequencesSeparators.expected @@ -7,8 +7,8 @@ | test.cpp:19:3:19:17 | 1370 | The digit sequence 01010101'1010 uses a digit sequence separator at a spacing other than 4. | | test.cpp:20:3:20:15 | 85 | The digit sequence 01'01'01'01 uses a digit sequence separator at a spacing other than 4. | | test.cpp:21:3:21:14 | 85 | The digit sequence 010'1010'1 uses a digit sequence separator at a spacing other than 4. | -| test.cpp:26:3:26:15 | 11000000000.0 | The digit sequence 1000'000 uses a digit sequence separator at a spacing other than 3. | -| test.cpp:27:3:27:16 | 11000000000.0 | The digit sequence 10'00'000 uses a digit sequence separator at a spacing other than 3. | -| test.cpp:28:3:28:17 | 11000000000.0 | The digit sequence 1'0 uses a digit sequence separator at a spacing other than 3. | -| test.cpp:29:3:29:16 | 11000000000.0 | The digit sequence 10'000'00 uses a digit sequence separator at a spacing other than 3. | -| test.cpp:30:3:30:15 | 11000000000.0 | The digit sequence 1'0 uses a digit sequence separator at a spacing other than 3. | +| test.cpp:26:3:26:15 | 1.1E10 | The digit sequence 1000'000 uses a digit sequence separator at a spacing other than 3. | +| test.cpp:27:3:27:16 | 1.1E10 | The digit sequence 10'00'000 uses a digit sequence separator at a spacing other than 3. | +| test.cpp:28:3:28:17 | 1.1E10 | The digit sequence 1'0 uses a digit sequence separator at a spacing other than 3. | +| test.cpp:29:3:29:16 | 1.1E10 | The digit sequence 10'000'00 uses a digit sequence separator at a spacing other than 3. | +| test.cpp:30:3:30:15 | 1.1E10 | The digit sequence 1'0 uses a digit sequence separator at a spacing other than 3. | diff --git a/cpp/autosar/test/rules/M2-13-4/LiteralSuffixNotUpperCase.expected b/cpp/autosar/test/rules/M2-13-4/LiteralSuffixNotUpperCase.expected index 9397fbac49..66fa304117 100644 --- a/cpp/autosar/test/rules/M2-13-4/LiteralSuffixNotUpperCase.expected +++ b/cpp/autosar/test/rules/M2-13-4/LiteralSuffixNotUpperCase.expected @@ -8,5 +8,5 @@ | test.cpp:16:3:16:14 | 1254450 | Numeric literal 0x13'24'32Ul has the lower case suffix l. | | test.cpp:17:3:17:13 | 1254450 | Numeric literal 0x13'24'32u has the lower case suffix u. | | test.cpp:18:3:18:13 | 1254450 | Numeric literal 0x13'24'32l has the lower case suffix l. | -| test.cpp:22:3:22:15 | 1.123122995e+10 | Numeric literal 1.123'123e10f has the lower case suffix f. | -| test.cpp:23:3:23:15 | 11231230000.0 | Numeric literal 1.123'123e10l has the lower case suffix l. | +| test.cpp:22:3:22:15 | 1.123123E10 | Numeric literal 1.123'123e10f has the lower case suffix f. | +| test.cpp:23:3:23:15 | 1.123123E10 | Numeric literal 1.123'123e10l has the lower case suffix l. | diff --git a/cpp/autosar/test/rules/M5-0-6/ImplicitConstConversionToSmallerUnderlyingType.expected b/cpp/autosar/test/rules/M5-0-6/ImplicitConstConversionToSmallerUnderlyingType.expected index 6b1d701128..00e191758c 100644 --- a/cpp/autosar/test/rules/M5-0-6/ImplicitConstConversionToSmallerUnderlyingType.expected +++ b/cpp/autosar/test/rules/M5-0-6/ImplicitConstConversionToSmallerUnderlyingType.expected @@ -1,2 +1,2 @@ | test.cpp:11:8:11:10 | (int8_t)... | Implicit conversion of integral $@ reduces the size from 4 bytes to 1 bytes. | test.cpp:11:8:11:10 | 256 | 256 | -| test.cpp:24:9:24:14 | (float)... | Implicit conversion of floating point $@ reduces the size from 8 bytes to 4 bytes. | test.cpp:24:9:24:14 | 3.500000000000000016e+38 | 3.5e38 | +| test.cpp:24:9:24:14 | (float)... | Implicit conversion of floating point $@ reduces the size from 8 bytes to 4 bytes. | test.cpp:24:9:24:14 | 3.5E38 | 3.5e38 | From 08b109db130cf4f908a0c4f3347d3a52da6d679e Mon Sep 17 00:00:00 2001 From: Jeroen Ketema Date: Mon, 18 May 2026 14:45:13 +0200 Subject: [PATCH 09/38] Update type alias class names --- .../src/rules/A14-5-2/NonTemplateMemberDefinedInTemplate.ql | 2 +- cpp/autosar/src/rules/M3-2-3/MultipleDeclarationViolation.ql | 2 +- cpp/common/src/codingstandards/cpp/types/Uses.qll | 4 ++-- .../RULE-4-1-2/UseOfDeprecatedFunctionBinderTypedefMember.ql | 2 +- .../src/rules/RULE-4-1-2/UseOfDeprecatedStdAllocatorMember.ql | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cpp/autosar/src/rules/A14-5-2/NonTemplateMemberDefinedInTemplate.ql b/cpp/autosar/src/rules/A14-5-2/NonTemplateMemberDefinedInTemplate.ql index a8fb1ace66..5e0e88e1a3 100644 --- a/cpp/autosar/src/rules/A14-5-2/NonTemplateMemberDefinedInTemplate.ql +++ b/cpp/autosar/src/rules/A14-5-2/NonTemplateMemberDefinedInTemplate.ql @@ -170,7 +170,7 @@ where ) and // Omit using alias (cf. https://github.com/github/codeql-coding-standards/issues/739) // Exclude Using alias which refer directly to a TypeParameter - not d.(UsingAliasTypedefType).getBaseType() instanceof TypeTemplateParameter + not d.(TypeAliasType).getBaseType() instanceof TypeTemplateParameter select d, "Member " + d.getName() + " template class does not use any of template arguments of its $@.", d.getDeclaringType(), "declaring type" diff --git a/cpp/autosar/src/rules/M3-2-3/MultipleDeclarationViolation.ql b/cpp/autosar/src/rules/M3-2-3/MultipleDeclarationViolation.ql index 30d94facb1..ce928f61ed 100644 --- a/cpp/autosar/src/rules/M3-2-3/MultipleDeclarationViolation.ql +++ b/cpp/autosar/src/rules/M3-2-3/MultipleDeclarationViolation.ql @@ -36,7 +36,7 @@ where kind = "variable" or de.getDeclaration() instanceof Type and - not de.getDeclaration() instanceof UsingAliasTypedefType and + not de.getDeclaration() instanceof TypeAliasType and kind = "type" ) and not otherDeclaration.isDefinition() and diff --git a/cpp/common/src/codingstandards/cpp/types/Uses.qll b/cpp/common/src/codingstandards/cpp/types/Uses.qll index 3cd63f4bc7..cb70e5fa7d 100644 --- a/cpp/common/src/codingstandards/cpp/types/Uses.qll +++ b/cpp/common/src/codingstandards/cpp/types/Uses.qll @@ -98,7 +98,7 @@ private Locatable getATypeUse_i(Type type, string reason) { or // Unless it's an alias template instantiation, as they do not have correct locations (last // verified in CodeQL CLI 2.7.6) - result instanceof UsingAliasTypedefType and + result instanceof TypeAliasType and not exists(result.getLocation()) ) and ( @@ -203,7 +203,7 @@ private Locatable getATypeUse_i(Type type, string reason) { // Alias templates - alias templates and instantiations are not properly captured by the // extractor (last verified in CodeQL CLI 2.7.6). The only distinguishing factor is that // instantiations of alias templates do not have a location. - exists(UsingAliasTypedefType template, UsingAliasTypedefType instantiation | + exists(TypeAliasType template, TypeAliasType instantiation | // Instantiation is a "use" of the template used = instantiation and type = template and diff --git a/cpp/misra/src/rules/RULE-4-1-2/UseOfDeprecatedFunctionBinderTypedefMember.ql b/cpp/misra/src/rules/RULE-4-1-2/UseOfDeprecatedFunctionBinderTypedefMember.ql index b31d217b71..f928457b08 100644 --- a/cpp/misra/src/rules/RULE-4-1-2/UseOfDeprecatedFunctionBinderTypedefMember.ql +++ b/cpp/misra/src/rules/RULE-4-1-2/UseOfDeprecatedFunctionBinderTypedefMember.ql @@ -58,7 +58,7 @@ class FunctionTypeByNestedClass extends FunctionTypeWithBindings { } } -class DeprecatedFunctionBinderTypedefMember extends UsingAliasTypedefType { +class DeprecatedFunctionBinderTypedefMember extends TypeAliasType { ClassTemplateInstantiation cti; DeprecatedFunctionBinderTypedefMember() { diff --git a/cpp/misra/src/rules/RULE-4-1-2/UseOfDeprecatedStdAllocatorMember.ql b/cpp/misra/src/rules/RULE-4-1-2/UseOfDeprecatedStdAllocatorMember.ql index 72a73a9b82..74f41437bd 100644 --- a/cpp/misra/src/rules/RULE-4-1-2/UseOfDeprecatedStdAllocatorMember.ql +++ b/cpp/misra/src/rules/RULE-4-1-2/UseOfDeprecatedStdAllocatorMember.ql @@ -24,7 +24,7 @@ abstract class DeprecatedUse extends Element { abstract string getAUseDescription(); } -class DeprecatedAllocatorUsingMember extends UsingAliasTypedefType, DeprecatedUse { +class DeprecatedAllocatorUsingMember extends TypeAliasType, DeprecatedUse { ClassTemplateInstantiation cti; DeprecatedAllocatorUsingMember() { From da5f26269c54c5c45bbc79dff918dae96c209587 Mon Sep 17 00:00:00 2001 From: Jeroen Ketema Date: Tue, 19 May 2026 11:18:17 +0200 Subject: [PATCH 10/38] Update expected test results --- .../UnusedTypeDeclarations.expected | 9 ++++----- cpp/common/test/rules/unusedtypedeclarations/test.cpp | 5 +++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/cpp/common/test/rules/unusedtypedeclarations/UnusedTypeDeclarations.expected b/cpp/common/test/rules/unusedtypedeclarations/UnusedTypeDeclarations.expected index a4538f01c5..6c80382e35 100644 --- a/cpp/common/test/rules/unusedtypedeclarations/UnusedTypeDeclarations.expected +++ b/cpp/common/test/rules/unusedtypedeclarations/UnusedTypeDeclarations.expected @@ -3,8 +3,7 @@ | test.cpp:13:11:13:11 | D | Type declaration D is not used. | | test.cpp:77:11:77:11 | R | Type declaration R is not used. | | test.cpp:90:12:90:12 | (unnamed class/struct/union) | Type declaration (unnamed class/struct/union) is not used. | -| test.cpp:111:29:111:30 | AA | Type declaration AA is not used. | -| test.cpp:126:7:126:12 | Nested | Type declaration Nested is not used. | -| test.cpp:135:9:135:20 | UnusedNested | Type declaration UnusedNested is not used. | -| test.cpp:138:7:138:22 | NestedBlockScope | Type declaration NestedBlockScope is not used. | -| test.cpp:149:11:149:16 | Unused | Type declaration Unused is not used. | +| test.cpp:127:7:127:12 | Nested | Type declaration Nested is not used. | +| test.cpp:136:9:136:20 | UnusedNested | Type declaration UnusedNested is not used. | +| test.cpp:139:7:139:22 | NestedBlockScope | Type declaration NestedBlockScope is not used. | +| test.cpp:150:11:150:16 | Unused | Type declaration Unused is not used. | diff --git a/cpp/common/test/rules/unusedtypedeclarations/test.cpp b/cpp/common/test/rules/unusedtypedeclarations/test.cpp index 2c2699af04..af404ff005 100644 --- a/cpp/common/test/rules/unusedtypedeclarations/test.cpp +++ b/cpp/common/test/rules/unusedtypedeclarations/test.cpp @@ -107,8 +107,9 @@ template class X { // COMPLIANT - template class never instantiated template class Y {}; // COMPLIANT - used in the test case below // Alias templates -template using Z = Y; // COMPLIANT - used below -template using AA = Y; // NON_COMPLIANT - never instantiated +template using Z = Y; // COMPLIANT - used below +template +using AA = Y; // NON_COMPLIANT[FALSE_NEGATIVE] - never instantiated void test_alias_template() { Z v; } From 4349da6efe95e312d7ee1e171f2a3ce314476404 Mon Sep 17 00:00:00 2001 From: Jeroen Ketema Date: Tue, 19 May 2026 11:23:37 +0200 Subject: [PATCH 11/38] Update references to deprecated classes --- cpp/common/src/codingstandards/cpp/Identifiers.qll | 2 +- cpp/common/src/codingstandards/cpp/deadcode/UnusedVariables.qll | 2 +- .../MultipleGlobalOrMemberDeclarators.qll | 2 +- .../NonVoidFunctionDoesNotReturn.qll | 2 +- .../UnnecessaryExposedIdentifierDeclarationShared.qll | 2 +- .../cpp/rules/unusedtypedeclarations/UnusedTypeDeclarations.qll | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cpp/common/src/codingstandards/cpp/Identifiers.qll b/cpp/common/src/codingstandards/cpp/Identifiers.qll index b1aaac9620..6240d207f1 100644 --- a/cpp/common/src/codingstandards/cpp/Identifiers.qll +++ b/cpp/common/src/codingstandards/cpp/Identifiers.qll @@ -22,7 +22,7 @@ class InterestingIdentifiers extends Declaration { InterestingIdentifiers() { not this.isFromTemplateInstantiation(_) and not this.isFromUninstantiatedTemplate(_) and - not this instanceof TemplateParameter and + not this instanceof TypeTemplateParameter and not this.hasDeclaringType() and not this instanceof Operator and not this.hasName("main") and diff --git a/cpp/common/src/codingstandards/cpp/deadcode/UnusedVariables.qll b/cpp/common/src/codingstandards/cpp/deadcode/UnusedVariables.qll index a0caabe624..0e21cf6cc2 100644 --- a/cpp/common/src/codingstandards/cpp/deadcode/UnusedVariables.qll +++ b/cpp/common/src/codingstandards/cpp/deadcode/UnusedVariables.qll @@ -13,7 +13,7 @@ import codingstandards.cpp.Scope */ class TemplateDependentType extends Type { TemplateDependentType() { - this instanceof TemplateParameter + this instanceof TypeTemplateParameter or exists(TemplateDependentType t | this.refersToDirectly(t) and diff --git a/cpp/common/src/codingstandards/cpp/rules/multipleglobalormemberdeclarators/MultipleGlobalOrMemberDeclarators.qll b/cpp/common/src/codingstandards/cpp/rules/multipleglobalormemberdeclarators/MultipleGlobalOrMemberDeclarators.qll index 05821d7270..712e61ab03 100644 --- a/cpp/common/src/codingstandards/cpp/rules/multipleglobalormemberdeclarators/MultipleGlobalOrMemberDeclarators.qll +++ b/cpp/common/src/codingstandards/cpp/rules/multipleglobalormemberdeclarators/MultipleGlobalOrMemberDeclarators.qll @@ -31,7 +31,7 @@ Query getQuery() { result instanceof MultipleGlobalOrMemberDeclaratorsSharedQuer class NonLocalUserDeclaration extends Declaration { NonLocalUserDeclaration() { not this instanceof StackVariable and - not this instanceof TemplateParameter and + not this instanceof TypeTemplateParameter and not this instanceof EnumConstant and not this instanceof TypedefType and not any(LambdaCapture lc).getField() = this and diff --git a/cpp/common/src/codingstandards/cpp/rules/nonvoidfunctiondoesnotreturn/NonVoidFunctionDoesNotReturn.qll b/cpp/common/src/codingstandards/cpp/rules/nonvoidfunctiondoesnotreturn/NonVoidFunctionDoesNotReturn.qll index cd5d1bdef4..2ee0a1a152 100644 --- a/cpp/common/src/codingstandards/cpp/rules/nonvoidfunctiondoesnotreturn/NonVoidFunctionDoesNotReturn.qll +++ b/cpp/common/src/codingstandards/cpp/rules/nonvoidfunctiondoesnotreturn/NonVoidFunctionDoesNotReturn.qll @@ -16,7 +16,7 @@ predicate functionsMissingReturnStmt(Function f, ControlFlowNode blame) { exists(Type returnType | returnType = f.getUnspecifiedType() and not returnType instanceof VoidType and - not returnType instanceof TemplateParameter + not returnType instanceof TypeTemplateParameter ) and exists(ReturnStmt s | f.getAPredecessor() = s and diff --git a/cpp/common/src/codingstandards/cpp/rules/unnecessaryexposedidentifierdeclarationshared/UnnecessaryExposedIdentifierDeclarationShared.qll b/cpp/common/src/codingstandards/cpp/rules/unnecessaryexposedidentifierdeclarationshared/UnnecessaryExposedIdentifierDeclarationShared.qll index 695a8740b6..8b0dcbc6c2 100644 --- a/cpp/common/src/codingstandards/cpp/rules/unnecessaryexposedidentifierdeclarationshared/UnnecessaryExposedIdentifierDeclarationShared.qll +++ b/cpp/common/src/codingstandards/cpp/rules/unnecessaryexposedidentifierdeclarationshared/UnnecessaryExposedIdentifierDeclarationShared.qll @@ -218,7 +218,7 @@ class CandidateDeclaration extends Declaration { or this instanceof Type and not this instanceof ClassTemplateInstantiation and - not this instanceof TemplateParameter + not this instanceof TypeTemplateParameter } } diff --git a/cpp/common/src/codingstandards/cpp/rules/unusedtypedeclarations/UnusedTypeDeclarations.qll b/cpp/common/src/codingstandards/cpp/rules/unusedtypedeclarations/UnusedTypeDeclarations.qll index b6d085619a..a0de4fe329 100644 --- a/cpp/common/src/codingstandards/cpp/rules/unusedtypedeclarations/UnusedTypeDeclarations.qll +++ b/cpp/common/src/codingstandards/cpp/rules/unusedtypedeclarations/UnusedTypeDeclarations.qll @@ -14,7 +14,7 @@ Query getQuery() { result instanceof UnusedTypeDeclarationsSharedQuery } query predicate problems(UserType ut, string message) { not isExcluded(ut, getQuery()) and message = "Type declaration " + ut.getName() + " is not used." and - not ut instanceof TemplateParameter and + not ut instanceof TypeTemplateParameter and not ut instanceof ProxyClass and not exists(getATypeUse(ut)) and not ut.isFromUninstantiatedTemplate(_) From 99a5245dbb7753d528008744651c3a213bee3bf0 Mon Sep 17 00:00:00 2001 From: Jeroen Ketema Date: Tue, 26 May 2026 19:15:44 +0200 Subject: [PATCH 12/38] Update references to deprecated classes --- cpp/common/src/codingstandards/cpp/Identifiers.qll | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpp/common/src/codingstandards/cpp/Identifiers.qll b/cpp/common/src/codingstandards/cpp/Identifiers.qll index 6240d207f1..3e651cfcb0 100644 --- a/cpp/common/src/codingstandards/cpp/Identifiers.qll +++ b/cpp/common/src/codingstandards/cpp/Identifiers.qll @@ -291,7 +291,7 @@ private module IdentifierIntroductionImpl { // A template parameter may itself be a template (`template class T>`). // The inner template parameter `template` is anonymous and does not introduce an // identifier. - not type.(TemplateParameter).isAnonymous() + not type.(TypeTemplateParameter).isAnonymous() or // In the above case, the template template parameter `T` is incorrectly marked as anonymous // in the database. But it does introduce the identifier `T`, so it must not be excluded. From 6a381b91b5736c232f7a2fb711b8684ca7968416 Mon Sep 17 00:00:00 2001 From: Jeroen Ketema Date: Wed, 29 Jul 2026 14:48:56 +0200 Subject: [PATCH 13/38] Fix queries after merge from main --- .../src/codingstandards/cpp/Extensions.qll | 7 ++--- .../PointerArithmeticFormsAnInvalidPointer.ql | 31 ++----------------- 2 files changed, 4 insertions(+), 34 deletions(-) diff --git a/cpp/common/src/codingstandards/cpp/Extensions.qll b/cpp/common/src/codingstandards/cpp/Extensions.qll index b085f89e5b..70cc34f69e 100644 --- a/cpp/common/src/codingstandards/cpp/Extensions.qll +++ b/cpp/common/src/codingstandards/cpp/Extensions.qll @@ -108,8 +108,8 @@ class CPPTerseTernaryExtension extends CPPCompilerExtension, ConditionalExpr { } /** - * A non-standard `Type` that is only available as a compiler extension, such as `__int128`, - * `_Decimal32`, `_Decimal64`, `_Decimal128`, or `__float128`. + * A non-standard `Type` that is only available as a compiler extension, such as `__int128` + * or `__float128`. * * Reference: https://gcc.gnu.org/onlinedocs/gcc/__int128.html * Reference: https://gcc.gnu.org/onlinedocs/gcc/Decimal-Float.html @@ -117,9 +117,6 @@ class CPPTerseTernaryExtension extends CPPCompilerExtension, ConditionalExpr { class CPPExtensionType extends Type { CPPExtensionType() { this instanceof Int128Type or - this instanceof Decimal128Type or - this instanceof Decimal32Type or - this instanceof Decimal64Type or this instanceof Float128Type } } diff --git a/cpp/misra/src/rules/RULE-8-7-1/PointerArithmeticFormsAnInvalidPointer.ql b/cpp/misra/src/rules/RULE-8-7-1/PointerArithmeticFormsAnInvalidPointer.ql index f2fd549207..65b78f07d7 100644 --- a/cpp/misra/src/rules/RULE-8-7-1/PointerArithmeticFormsAnInvalidPointer.ql +++ b/cpp/misra/src/rules/RULE-8-7-1/PointerArithmeticFormsAnInvalidPointer.ql @@ -159,10 +159,10 @@ class ArrayAllocation extends TArrayAllocation { * array, and the minimum estimated value for a heap-allocated one. */ int getLength(DataFlow::Node node) { - exists(IndirectUninitializedNode inode | + exists(DataFlow::IndirectUninitializedNode inode | inode = node and inode.getLocalVariable() = this.asStackAllocation().getVariable() and - result = this.asStackAllocation().getLength(inode.getIndirection()) + result = this.asStackAllocation().getLength(inode.getIndirectionIndex()) ) or node.asUninitialized() = this.asStackAllocation().getVariable() and @@ -193,33 +193,6 @@ class ArrayAllocation extends TArrayAllocation { } } -/* - * NOTE: `IndirectUninitializedNode` has made its way into `github/codeql`. Once we upgrade it to - * the version that has it, the class can be safely removed. - */ - -import semmle.code.cpp.ir.dataflow.internal.SsaInternals as SsaImpl - -class IndirectUninitializedNode extends Node { - LocalVariable v; - int indirection; - - IndirectUninitializedNode() { - exists(SsaImpl::Definition def, SsaImpl::SourceVariable sv | - def.getIndirectionIndex() = indirection and - indirection > 0 and - def.getValue().asInstruction() instanceof UninitializedInstruction and - SsaImpl::defToNode(this, def, sv) and - v = sv.getBaseVariable().(SsaImpl::BaseIRVariable).getIRVariable().getAst() - ) - } - - /** Gets the uninitialized local variable corresponding to this node. */ - LocalVariable getLocalVariable() { result = v } - - int getIndirection() { result = indirection } -} - newtype TPointerFormation = TArrayExpr(ArrayExprBA arrayExpr) or TPointerArithmetic(PointerArithmeticOperation pointerArithmetic) or From e5a6d50fd7b2e46a9b5b897860b86f7286baeaeb Mon Sep 17 00:00:00 2001 From: Jan Schlosser Date: Mon, 3 Aug 2026 16:19:41 +0200 Subject: [PATCH 14/38] Fix RULE-0-2-4/A0-1-3 false positives for private functions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two categories of false positive are addressed: 1. **Private pure virtual functions used via the NVI idiom** — `DynamicCallGraph::getTarget()` resolves a virtual call to the implementations that may actually *run*. A pure virtual function (`= 0`) has no body, so it is never a viable dispatch target and is therefore never returned by `getTarget()` — not even when it is unambiguously named by a call, as in the non-virtual interface (NVI) idiom where a public member calls a private pure virtual. It was consequently reported as unused even though a sibling member calls it. `functionIsCalled` now also counts the *statically named* callee (`FunctionCall.getTarget()`), which recovers exactly that case. This is deliberately narrower than excluding `PureVirtualFunction` from `LocalFunction` outright: a private pure virtual that is genuinely never called and never overridden is still reported. 2. **Private members of never-instantiated class templates** — when a class template is never instantiated with a concrete type anywhere in the analyzed compilation units, Clang never elaborates a body for its member functions, so `Call`/`FunctionCall` targets within that pattern's own text cannot be resolved by `DynamicCallGraph::getTarget()` or `VirtualDispatch`, even for calls between sibling members of the very same class (e.g. a public entry point calling a private helper). This is common for generic "plumbing" library code (CRTP-style wrappers and the like) that is only ever instantiated by downstream consumers outside the analyzed codebase. The new `hasNoVisibleInstantiation(fn)` predicate conservatively treats such private members as "used" (out of scope for this analysis) rather than reporting them as dead code — but only when *no* sibling member of the same class has any instantiation either, so genuinely dead private helpers in class templates that *are* instantiated elsewhere are still correctly reported. The sibling-instantiation check is factored into a `pragma[noinline]` predicate over the declaring `Class` rather than over the member `Function`. Inlined into the caller, the join orderer loses the fact that the class is functionally determined and materialises the full (member, sibling) cross product per class before projecting it away. On a large real-world database this cut the peak intermediate relation for that predicate from 4,831,818 tuples to 7,700 with identical results. Fixes #1168 --- ...3-unused-local-function-false-positives.md | 16 ++++ .../UnusedLocalFunction.qll | 80 ++++++++++++++++++- .../UnusedLocalFunction.expected | 2 + .../test/rules/unusedlocalfunction/test.cpp | 80 ++++++++++++++++++- 4 files changed, 175 insertions(+), 3 deletions(-) create mode 100644 change_notes/2026-08-03-unused-local-function-false-positives.md diff --git a/change_notes/2026-08-03-unused-local-function-false-positives.md b/change_notes/2026-08-03-unused-local-function-false-positives.md new file mode 100644 index 0000000000..88300791ab --- /dev/null +++ b/change_notes/2026-08-03-unused-local-function-false-positives.md @@ -0,0 +1,16 @@ +- `A0-1-3`, `RULE-0-2-4` - `UnusedLocalFunction.ql`: + - Fixed false positives for private pure virtual functions used through the non-virtual + interface (NVI) idiom. `DynamicCallGraph::getTarget()` resolves a virtual call to the + implementations that may actually run; a pure virtual function has no body, so it is + never a viable dispatch target and was reported as unused even when a sibling member + called it. A call is now also counted when the function is the statically named + callee. Pure virtual functions that are genuinely never called and never overridden + are still reported. + - Excluded private member functions of class templates that are never concretely + instantiated anywhere in the database (and where no sibling member of the same + class-template pattern is instantiated either). Clang never elaborates a body for the + members of such patterns, so calls between sibling members of the same + never-instantiated class (e.g. a public entry point calling a private helper) cannot be + resolved by the call graph. This is common for generic "plumbing" library code + (CRTP-style wrappers, etc.) that is only ever + instantiated by downstream consumers outside of the analyzed codebase. diff --git a/cpp/common/src/codingstandards/cpp/rules/unusedlocalfunction/UnusedLocalFunction.qll b/cpp/common/src/codingstandards/cpp/rules/unusedlocalfunction/UnusedLocalFunction.qll index 39715e484f..258f25aa94 100644 --- a/cpp/common/src/codingstandards/cpp/rules/unusedlocalfunction/UnusedLocalFunction.qll +++ b/cpp/common/src/codingstandards/cpp/rules/unusedlocalfunction/UnusedLocalFunction.qll @@ -20,11 +20,84 @@ predicate overloadedFunctionIsCalled(Function unusedFunction) { exists(Function f | f = unusedFunction.getAnOverload() and f = getTarget(_)) } +/** + * Holds if `fn` is the target of some call, either statically or according to the + * dynamic call graph. + * + * `DynamicCallGraph::getTarget()` resolves a virtual call to the functions that may + * actually run, i.e. the overriding implementations. A pure virtual function has no + * body, so it is never a viable dispatch target and is therefore *never* returned by + * `getTarget()` -- even when it is unambiguously named by a call, as in the + * non-virtual interface (NVI) idiom where a public member calls a private pure + * virtual. The additional static `FunctionCall.getTarget()` disjunct recovers exactly + * that case: the callee as written in the source. + */ +predicate functionIsCalled(Function fn) { + fn = getTarget(_) + or + // The statically named callee, which the dynamic call graph drops for calls that + // dispatch to an override (notably pure virtual functions, which have no body). + exists(FunctionCall fc | fc.getTarget() = fn) +} + /** Checks if a Function's address was taken. */ predicate addressBeenTaken(Function unusedFunction) { exists(FunctionAccess fa | fa.getTarget() = unusedFunction) } +/** + * Holds if some member of the class `c` has at least one concrete instantiation anywhere in the + * database. + * + * If this holds for the declaring type of a member function `fn`, the class template is genuinely + * "alive" (used with a concrete type somewhere), and the fact that `fn` itself was never + * instantiated is real evidence that it is unused: for a member function to lack a concrete + * instantiation while sibling members do have one, it must never have been called from any of + * those sibling bodies. + * + * `pragma[noinline]` keeps this a standalone relation of arity one. Inlined into the caller, the + * join orderer loses the fact that `c` is functionally determined and materialises the full + * (member, sibling) cross product per class before projecting it away, which is quadratic in the + * size of the largest class. + */ +pragma[noinline] +private predicate classHasAnyInstantiatedMember(Class c) { + exists(Function sibling, Function siblingInstantiation | + sibling.getDeclaringType() = c and + siblingInstantiation.isConstructedFrom(sibling) + ) +} + +/** + * Holds if `fn` is a function from an uninstantiated template for which no concrete + * instantiation exists anywhere in the database, and no other member of the same + * class-template pattern is instantiated either. + * + * When a class template is never instantiated with a concrete type in the analyzed + * compilation units, Clang never elaborates a body for its member functions, so + * `Call`/`FunctionCall` targets within that pattern's own text cannot be resolved by + * `DynamicCallGraph::getTarget()` or `VirtualDispatch`, even for calls between sibling members + * of the very same class (e.g. a constructor calling a private helper). This is common for + * generic "plumbing" library code (CRTP-style wrappers, etc.) + * that is only ever instantiated by downstream consumers outside of this codebase. In that + * situation we have no visibility at all into the call graph, so we conservatively treat the + * function as "used" (out of scope for this analysis) rather than report it as dead code. + * + * We only do this when *no* sibling member of the class pattern has an instantiation either + * (see `classHasAnyInstantiatedMember`): if some sibling *is* instantiated, the class is + * genuinely used, and `fn` lacking an instantiation is real (not merely missing) evidence that + * it is unused. + */ +predicate hasNoVisibleInstantiation(Function fn) { + // Restricted to class-template members: a standalone function template that is never + // instantiated anywhere is genuinely dead code, and detecting that does not suffer from the + // "sibling member of the same class" ambiguity this predicate is designed for. + fn instanceof MemberFunction and + fn.isFromUninstantiatedTemplate(_) and + not exists(Function instantiation | instantiation.isConstructedFrom(fn)) and + not classHasAnyInstantiatedMember(fn.getDeclaringType()) +} + /** A `Function` nested in an anonymous namespace. */ class AnonymousNamespaceFunction extends Function { AnonymousNamespaceFunction() { getNamespace().getParentNamespace*().isAnonymous() } @@ -74,7 +147,7 @@ module UnusedLocalFunction { query predicate problems(LocalFunction unusedLocalFunction, string message) { not isExcluded(unusedLocalFunction, Config::getQuery()) and // No static or dynamic call target for this function - not unusedLocalFunction = getTarget(_) and + not functionIsCalled(unusedLocalFunction) and // If this is a TemplateFunction or an instantiation of a template, then only report it as unused // if all other instantiations of the template are unused not exists( @@ -88,7 +161,7 @@ module UnusedLocalFunction { | // There exists an instantiation which is called functionFromInstantiatedTemplate.isConstructedFrom(functionFromUninstantiatedTemplate) and - functionFromInstantiatedTemplate = getTarget(_) + functionIsCalled(functionFromInstantiatedTemplate) ) and // A function is defined as "used" if any one of the following holds true: // - It's an explicitly deleted functions e.g. =delete @@ -100,6 +173,9 @@ module UnusedLocalFunction { not unusedLocalFunction.getAnAttribute().getName() = "maybe_unused" and not overloadedFunctionIsCalled(unusedLocalFunction) and not addressBeenTaken(unusedLocalFunction) and + // We have no visibility into the call graph of a template that is never instantiated + // anywhere in the database, so we cannot reliably tell it is unused. + not hasNoVisibleInstantiation(unusedLocalFunction) and message = unusedLocalFunction.getLocalFunctionType() + " function " + unusedLocalFunction.getName() + " is not statically called, or is in an unused template." diff --git a/cpp/common/test/rules/unusedlocalfunction/UnusedLocalFunction.expected b/cpp/common/test/rules/unusedlocalfunction/UnusedLocalFunction.expected index d3de068e9c..df9322e7d7 100644 --- a/cpp/common/test/rules/unusedlocalfunction/UnusedLocalFunction.expected +++ b/cpp/common/test/rules/unusedlocalfunction/UnusedLocalFunction.expected @@ -6,3 +6,5 @@ | test.cpp:85:6:85:7 | h3 | Anonymous namespace function h3 is not statically called, or is in an unused template. | | test.cpp:144:8:144:8 | f | Anonymous namespace class member function f is not statically called, or is in an unused template. | | test.cpp:150:8:150:8 | f | Anonymous namespace class member function f is not statically called, or is in an unused template. | +| test.cpp:214:9:214:18 | deadHelper | Private member function deadHelper is not statically called, or is in an unused template. | +| test.cpp:236:16:236:28 | neverUsedPure | Private member function neverUsedPure is not statically called, or is in an unused template. | diff --git a/cpp/common/test/rules/unusedlocalfunction/test.cpp b/cpp/common/test/rules/unusedlocalfunction/test.cpp index 9ce37dcaae..45f28665fc 100644 --- a/cpp/common/test/rules/unusedlocalfunction/test.cpp +++ b/cpp/common/test/rules/unusedlocalfunction/test.cpp @@ -157,4 +157,82 @@ class C3 { public: void f() {} // COMPLIANT - public external linkage }; -} // namespace N1 \ No newline at end of file +} // namespace N1 + +class PureVirtualBase { +public: + void callImpl() { impl(); } + +private: + virtual void impl() = 0; // COMPLIANT - pure virtual contract. +}; + +class PureVirtualDerived : public PureVirtualBase { +private: + void impl() override {} +}; + +void test_pure_virtual_private_member() { + PureVirtualDerived derived; + derived.callImpl(); +} + +/** + * Class templates that are never instantiated anywhere in the analyzed + * compilation units. + * + * Clang never elaborates a body for the members of such patterns, so calls + * between sibling members (even genuine ones, like a public entry point calling + * a private helper) cannot be resolved by the call graph. We conservatively + * treat all of them as used, rather than risk reporting them as dead code. + */ +template class NeverInstantiatedFactory { +public: + static void Create() { instanceHelper(); } + +private: + static void instanceHelper() { + } // COMPLIANT - class template is never instantiated anywhere in this + // translation unit, so the analysis has no visibility into whether + // `Create` (also never instantiated) really calls it; conservatively + // not reported. +}; + +/** + * A class template that *is* instantiated (and its caller genuinely used), so + * the ordinary per-instantiation call-graph reasoning applies and a + * truly-unused private helper is still correctly reported. + */ +template class InstantiatedFactory { +public: + UsedT get() { return makeValue(); } + +private: + UsedT makeValue() { + return UsedT(); + } // COMPLIANT - called by get(), which is instantiated. + UsedT deadHelper() { // NON_COMPLIANT - never called, and the class template + // is instantiated, so the analysis does have visibility + // into this member. + return UsedT(); + } +}; + +void test_instantiated_factory() { + InstantiatedFactory factory; + factory.get(); +} +/** + * A private pure virtual that is genuinely dead: it is never called through the + * non-virtual interface, and no derived class ever overrides it. Pure virtual + * functions are deliberately in scope for this query (see + * `UnusedFunctions::UsableFunction`), so this must still be reported. + */ +class DeadPureVirtualBase { +public: + void unrelated() {} + +private: + virtual void neverUsedPure() = 0; // NON_COMPLIANT - never called, never + // overridden. +}; From a7f144a3b0c6c37a81daab10dc9170ffca7cdaf5 Mon Sep 17 00:00:00 2001 From: Jan Schlosser Date: Fri, 21 Aug 2026 08:39:47 +0200 Subject: [PATCH 15/38] Fix RULE-7-0-4 false positives for non-numeric operand types `InappropriateBitwiseOrShiftOperands.ql` reported operations that do not use the built-in bitwise or shift operators, most notably the stream insertion and extraction operators, e.g. `stream << value`. The operand checks used `not MisraCpp23BuiltInTypes::isUnsignedType(type)`. That predicate takes a `NumericType`, so it does not hold for a type that has no MISRA numeric type at all, and negating it makes the check vacuously true for every such type. Class types and the unresolved dependent types of uninstantiated template bodies were therefore reported as non-compliant operands. The checks now use `MisraCpp23BuiltInTypes::isSignedType(type)` instead, which only holds for an operand that has a MISRA numeric type and is signed. This does not introduce false negatives for dependent operands, because the template instantiations, in which the operand types are known, are still reported. Operands of character type, of a non-standard integral type, and of an unscoped enumeration type without a fixed underlying type are consequently no longer reported, because none of them has a MISRA numeric type. Unscoped enumerations without a fixed underlying type are covered by RULE-10-2-3. Fixes #1177 --- ...fp-rule-7-0-4-non-numeric-operand-types.md | 11 +++ .../InappropriateBitwiseOrShiftOperands.ql | 10 +-- ...appropriateBitwiseOrShiftOperands.expected | 3 + cpp/misra/test/rules/RULE-7-0-4/test.cpp | 68 ++++++++++++++++++- 4 files changed, 86 insertions(+), 6 deletions(-) create mode 100644 change_notes/2026-08-20-fix-fp-rule-7-0-4-non-numeric-operand-types.md diff --git a/change_notes/2026-08-20-fix-fp-rule-7-0-4-non-numeric-operand-types.md b/change_notes/2026-08-20-fix-fp-rule-7-0-4-non-numeric-operand-types.md new file mode 100644 index 0000000000..d8415a8ca3 --- /dev/null +++ b/change_notes/2026-08-20-fix-fp-rule-7-0-4-non-numeric-operand-types.md @@ -0,0 +1,11 @@ +- `RULE-7-0-4` - `InappropriateBitwiseOrShiftOperands.ql`: + - Fixes #1177 - the rule no longer reports operands whose type is not a MISRA numeric type. The + operand checks used `not isUnsignedType(operandType)`, which is vacuously true for every type + that has no MISRA numeric type at all, such as class types and the unresolved dependent types + of uninstantiated template bodies. As a result the rule reported operations that do not use + the built-in operators, most notably the stream insertion and extraction operators. The checks + now use `isSignedType(operandType)` instead. + - Operands of character type, of a non-standard integral type, and of an unscoped enumeration + type without a fixed underlying type are consequently no longer reported, because none of them + has a MISRA numeric type. Unscoped enumerations without a fixed underlying type are covered by + `RULE-10-2-3`. diff --git a/cpp/misra/src/rules/RULE-7-0-4/InappropriateBitwiseOrShiftOperands.ql b/cpp/misra/src/rules/RULE-7-0-4/InappropriateBitwiseOrShiftOperands.ql index f0992d2f0f..344efbc934 100644 --- a/cpp/misra/src/rules/RULE-7-0-4/InappropriateBitwiseOrShiftOperands.ql +++ b/cpp/misra/src/rules/RULE-7-0-4/InappropriateBitwiseOrShiftOperands.ql @@ -63,7 +63,7 @@ where | x = op.getLeftOperand() and operandType = op.getLeftOperand().getExplicitlyConverted().getType() and - not MisraCpp23BuiltInTypes::isUnsignedType(operandType) and + MisraCpp23BuiltInTypes::isSignedType(operandType) and message = "Bitwise operator '" + op.getOperator() + "' requires unsigned numeric operands, but the left operand has type '" + operandType + @@ -71,7 +71,7 @@ where or x = op.getRightOperand() and operandType = op.getRightOperand().getExplicitlyConverted().getType() and - not MisraCpp23BuiltInTypes::isUnsignedType(operandType) and + MisraCpp23BuiltInTypes::isSignedType(operandType) and message = "Bitwise operator '" + op.getOperator() + "' requires unsigned numeric operands, but the right operand has type '" + operandType + @@ -82,7 +82,7 @@ where exists(ComplementExpr comp, Type opType | x = comp.getOperand() and opType = comp.getOperand().getExplicitlyConverted().getType() and - not MisraCpp23BuiltInTypes::isUnsignedType(opType) and + MisraCpp23BuiltInTypes::isSignedType(opType) and message = "Bit complement operator '~' requires unsigned operand, but has type '" + opType + "'." ) @@ -91,7 +91,7 @@ where exists(BinaryShiftOpOrAssignOp shift, Type leftType | x = shift.getLeftOperand() and leftType = shift.getLeftOperand().getExplicitlyConverted().getType() and - not MisraCpp23BuiltInTypes::isUnsignedType(leftType) and + MisraCpp23BuiltInTypes::isSignedType(leftType) and not isSignedConstantLeftShiftException(shift) and message = "Shift operator '" + shift.getOperator() + @@ -112,7 +112,7 @@ where "Shift operator '" + shift.getOperator() + "' shifts by " + right.getValue().toInt() + " which is not within the valid range 0.." + ((leftType.getSize() * 8) - 1) + "." else ( - not MisraCpp23BuiltInTypes::isUnsignedType(rightType) and + MisraCpp23BuiltInTypes::isSignedType(rightType) and message = "Shift operator '" + shift.getOperator() + "' requires unsigned right operand, but has type '" + rightType + "'." diff --git a/cpp/misra/test/rules/RULE-7-0-4/InappropriateBitwiseOrShiftOperands.expected b/cpp/misra/test/rules/RULE-7-0-4/InappropriateBitwiseOrShiftOperands.expected index 3022ea3923..3d7323b3cf 100644 --- a/cpp/misra/test/rules/RULE-7-0-4/InappropriateBitwiseOrShiftOperands.expected +++ b/cpp/misra/test/rules/RULE-7-0-4/InappropriateBitwiseOrShiftOperands.expected @@ -47,3 +47,6 @@ | test.cpp:156:3:156:12 | 1073741824 | Shift operator '<<' requires unsigned left operand, but has type 'int'. | | test.cpp:162:3:162:5 | s32 | Shift operator '<<' requires unsigned left operand, but has type 'int32_t'. | | test.cpp:170:3:170:5 | s32 | Shift operator '>>' requires unsigned left operand, but has type 'int32_t'. | +| test.cpp:201:3:201:7 | value | Shift operator '<<' requires unsigned left operand, but has type 'signed int'. | +| test.cpp:226:3:226:4 | e3 | Bitwise operator '&' requires unsigned numeric operands, but the left operand has type 'UnscopedEnumSignedUnderlyingType'. | +| test.cpp:226:7:226:8 | e3 | Bitwise operator '&' requires unsigned numeric operands, but the right operand has type 'UnscopedEnumSignedUnderlyingType'. | diff --git a/cpp/misra/test/rules/RULE-7-0-4/test.cpp b/cpp/misra/test/rules/RULE-7-0-4/test.cpp index 110c50070e..674e6ca4a3 100644 --- a/cpp/misra/test/rules/RULE-7-0-4/test.cpp +++ b/cpp/misra/test/rules/RULE-7-0-4/test.cpp @@ -168,4 +168,70 @@ void test_right_shift_signed_operands() { u32 >> 1U; // COMPLIANT s32 >> 1U; // NON_COMPLIANT -} \ No newline at end of file +} + +class TestStream { +public: + TestStream &operator<<(std::int32_t value); + TestStream &operator>>(std::int32_t &value); +}; + +void test_overloaded_shift_operators() { + TestStream stream; + std::int32_t s32 = 1; + + // User provided operators, not the built-in shift operators + stream << 1; // COMPLIANT + stream << s32; // COMPLIANT + stream >> s32; // COMPLIANT +} + +template +void test_overloaded_shift_operators_in_template(TestStream &stream, + const T &value) { + // The left operand of the second `<<` is the `TestStream &` returned by the + // first one, and the right operand is dependent, so the operation is + // unresolved in the uninstantiated template body + stream << 1 << value; // COMPLIANT +} + +template void test_dependent_shift_operands(T value) { + // Dependent operands are unresolved in the uninstantiated template body, but + // reported through the instantiation below + value << 2; // NON_COMPLIANT +} + +void test_template_instantiations() { + TestStream stream; + test_overloaded_shift_operators_in_template(stream, 1); + test_dependent_shift_operands(1); +} +enum UnscopedEnumNoFixedUnderlyingType { EnumeratorA = 1, EnumeratorB = 2 }; + +enum UnscopedEnumUnsignedUnderlyingType : unsigned int { EnumeratorC = 1 }; + +enum UnscopedEnumSignedUnderlyingType : int { EnumeratorD = 1 }; + +void test_enum_operands() { + UnscopedEnumNoFixedUnderlyingType e1 = EnumeratorA; + UnscopedEnumUnsignedUnderlyingType e2 = EnumeratorC; + UnscopedEnumSignedUnderlyingType e3 = EnumeratorD; + + // Without a fixed underlying type the enum has no MISRA numeric type, so the + // operands are not analysed by this rule + e1 &e1; // COMPLIANT + + e2 &e2; // COMPLIANT + + e3 &e3; // NON_COMPLIANT +} + +void test_character_type_operands() { + char32_t c32 = 1; + + // `char32_t` is of character type, not of numeric type, and is always + // unsigned + c32 &c32; // COMPLIANT + c32 << 1U; // COMPLIANT + ~c32; // COMPLIANT +} From 45faccd62a37e4996fef592d10d565668670cc3f Mon Sep 17 00:00:00 2001 From: Jan Schlosser Date: Mon, 24 Aug 2026 16:47:12 +0200 Subject: [PATCH 16/38] Fix RULE-5-10-1 false positives for locals/parameters in std specializations RULE-5-10-1 (poorly-formed identifier) flagged ordinary, well-formed, snake_case local variables and function parameters (e.g. `value`, `result`, `view`, `instance_identifier`) with "Identifier 'X' is defined in reserved namespace." whenever they were declared inside the body of an explicit template specialization that C++ explicitly permits users to add to namespace `std`, most commonly `std::hash::operator()`. On the eclipse-score/communication codebase this produced 66 findings, all inside `std::hash`- style specializations in headers such as handle_type.h, trace_point_key.h and service_identifier_type.h. Root cause: `VariableDeclarationEntryIdentifier::getNamespace()` used `Variable.getNamespace()` directly. For a `Parameter` or `LocalVariable`, the upstream CodeQL C++ library defines this as the namespace of the *enclosing function* (see `codeql/cpp-all/.../Declaration.qll`), which is a reasonable general notion of "namespace context" but is not what RULE-5-10-1 means by "is defined in reserved namespace". A block-scope local or parameter is scoped to the body of its enclosing function; it is not itself a member of that function's enclosing namespace and therefore cannot introduce a new name into (or "pollute") a reserved namespace such as `std`, regardless of which namespace the enclosing function happens to be declared in. This is exactly the situation for the body of a permitted `std::hash` specialization: the parameter and local names are ordinary user-chosen identifiers that merely happen to be lexically nested inside `namespace std { ... }` because the standard requires the specialization to be written there. Fix: in `VariableDeclarationEntryIdentifier`, only report a namespace for variables that are not `LocalScopeVariable` (i.e. not a `Parameter` or `LocalVariable`). This is a narrow, semantically-motivated scope check, not a name- or path-based exclusion: any genuinely new namespace-scope or class-scope member added directly to `std` (a new global, function, type, or the specialization itself) is still checked independently via `FunctionDeclarationEntryIdentifier` / `TypeDeclarationEntryIdentifier`, and remains flagged. A new NON_COMPLIANT test case (a function declared directly in `namespace std`) confirms this is unaffected. Added a regression test reproducing the `std::hash` specialization shape with a parameter and a local both named after the FP pattern (COMPLIANT), and confirmed with the "teeth" test that reverting only `Identifiers.qll` while keeping the new test makes it fail with exactly the two spurious findings. The existing RULE-5-10-1 test suite and the shared Identifiers library test continue to pass. Validated against the real eclipse-score/communication CodeQL database (`//score/message_passing //score/mw/com`): "is defined in reserved namespace" findings for this shape dropped from 66 to 0, while the one, unrelated "starts with underscore" finding in the same rule is unchanged. All 66 baseline findings were manually confirmed to be locals/parameters inside `std::hash`-style specializations, i.e. genuine false positives. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- ...-hash-specialization-reserved-namespace.md | 5 +++ .../src/codingstandards/cpp/Identifiers.qll | 15 ++++++- .../PoorlyFormedIdentifier.expected | 1 + cpp/misra/test/rules/RULE-5-10-1/test.cpp | 41 ++++++++++++++++++- 4 files changed, 60 insertions(+), 2 deletions(-) create mode 100644 change_notes/2026-08-24-fix-fp-rule-5-10-1-hash-specialization-reserved-namespace.md diff --git a/change_notes/2026-08-24-fix-fp-rule-5-10-1-hash-specialization-reserved-namespace.md b/change_notes/2026-08-24-fix-fp-rule-5-10-1-hash-specialization-reserved-namespace.md new file mode 100644 index 0000000000..d50c5ea90d --- /dev/null +++ b/change_notes/2026-08-24-fix-fp-rule-5-10-1-hash-specialization-reserved-namespace.md @@ -0,0 +1,5 @@ +- `RULE-5-10-1` - `PoorlyFormedIdentifier.ql`: + - Fixed false positives where a local variable or function parameter was reported as + "defined in reserved namespace" merely because its enclosing function is the body of + an explicit template specialization that C++ permits users to add to namespace `std` + (for example, `std::hash::operator()`'s parameter and local names). diff --git a/cpp/common/src/codingstandards/cpp/Identifiers.qll b/cpp/common/src/codingstandards/cpp/Identifiers.qll index 23751ac264..cbacb9b8e2 100644 --- a/cpp/common/src/codingstandards/cpp/Identifiers.qll +++ b/cpp/common/src/codingstandards/cpp/Identifiers.qll @@ -361,7 +361,20 @@ private module IdentifierIntroductionImpl { override string getAnIdent() { result = this.getName() } - override Namespace getNamespace() { result = variable.getNamespace() } + override Namespace getNamespace() { + // A parameter or local variable is scoped to the body of its enclosing function, not to + // that function's enclosing namespace. It does not itself become a new member of the + // namespace, so it cannot "pollute" a reserved namespace such as `std`, regardless of which + // namespace its enclosing function happens to be declared in. This matters in particular + // for the bodies of explicit template specializations that C++ explicitly permits users to + // add to namespace `std` (such as `std::hash`), where parameter and local names + // are otherwise ordinary user-chosen identifiers that merely happen to be lexically nested + // inside `namespace std { ... }`. The function or class that actually introduces the + // specialization's name is still checked against `isReservedNamespace` independently, via + // `FunctionDeclarationEntryIdentifier` / `TypeDeclarationEntryIdentifier`. + not variable instanceof LocalScopeVariable and + result = variable.getNamespace() + } } /** diff --git a/cpp/misra/test/rules/RULE-5-10-1/PoorlyFormedIdentifier.expected b/cpp/misra/test/rules/RULE-5-10-1/PoorlyFormedIdentifier.expected index 1c5abc431b..ad045a88a5 100644 --- a/cpp/misra/test/rules/RULE-5-10-1/PoorlyFormedIdentifier.expected +++ b/cpp/misra/test/rules/RULE-5-10-1/PoorlyFormedIdentifier.expected @@ -51,3 +51,4 @@ | test.cpp:186:7:186:12 | wint_t | Identifier 'wint_t' is a reserved name. | | test.cpp:203:1:203:42 | __PRETTY_FUNCTION__ | Identifier '__PRETTY_FUNCTION__' contains double underscores. | | test.cpp:203:1:203:42 | __PRETTY_FUNCTION__ | Identifier '__PRETTY_FUNCTION__' starts with underscore. | +| test.cpp:263:6:263:21 | new_std_function | Identifier 'new_std_function' is defined in reserved namespace. | diff --git a/cpp/misra/test/rules/RULE-5-10-1/test.cpp b/cpp/misra/test/rules/RULE-5-10-1/test.cpp index b529a971ca..3f74e104c6 100644 --- a/cpp/misra/test/rules/RULE-5-10-1/test.cpp +++ b/cpp/misra/test/rules/RULE-5-10-1/test.cpp @@ -222,4 +222,43 @@ struct hash { // COMPLIANT - rule does not apply to template std::size_t operator()(const int &x) const { return static_cast(x); } -}; \ No newline at end of file +}; + +// Test case for RULE-5-10-1 false positive fix: a local variable or function +// parameter is scoped to the body of its enclosing function, not to the +// namespace that function happens to be declared in. This matters for the +// body of an explicit template specialization that C++ explicitly permits +// users to add to namespace `std` (such as `std::hash`): the +// parameter and local names below are ordinary user-chosen identifiers and +// do not themselves become new members of namespace `std`. +struct UserTypeForHash { + int payload; +}; + +namespace std { +template +struct hash; // forward declaration of the primary + // template that is specialized below + +template <> struct hash { + std::size_t + operator()(const UserTypeForHash &value) const noexcept { // COMPLIANT - + // 'value' is a + // parameter + // scoped to the + // function body, + // not a member + // of namespace + // std + std::size_t result = static_cast( + value.payload); // COMPLIANT - 'result' is a local variable scoped to + // the function body, not a member of namespace std + return result; + } +}; + +// A genuinely new function declared directly in namespace std remains a +// violation: this is not a permitted specialization, and it does introduce a +// new name into the reserved namespace. +void new_std_function() {} // NON_COMPLIANT - namespace std is reserved +} // namespace std \ No newline at end of file From f7b5ada27eaf1fd616d5e85df8151cb5cbfecea7 Mon Sep 17 00:00:00 2001 From: Mauro Baluda Date: Wed, 26 Aug 2026 22:22:08 +0200 Subject: [PATCH 17/38] Upgrade CodeQL caching and dependencies installation Updated CodeQL workflow to use caching --- .github/workflows/codeql_unit_tests.yml | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/.github/workflows/codeql_unit_tests.yml b/.github/workflows/codeql_unit_tests.yml index 23d6972a13..400fe8d2ba 100644 --- a/.github/workflows/codeql_unit_tests.yml +++ b/.github/workflows/codeql_unit_tests.yml @@ -17,7 +17,6 @@ on: - "rc/**" jobs: - prepare-unit-test-matrix: name: Prepare CodeQL unit test matrix runs-on: ubuntu-22.04 @@ -58,16 +57,15 @@ jobs: run: pip install -r scripts/requirements.txt - name: Cache CodeQL - id: cache-codeql - uses: actions/cache@v5 + uses: actions/cache@v6 with: - # A list of files, directories, and wildcard patterns to cache and restore - path: ${{github.workspace}}/codeql_home - # An explicit key for restoring and saving the cache - key: codeql-home-${{matrix.os}}-${{matrix.codeql_cli}}-${{matrix.codeql_standard_library}} + path: ~/.codeql + key: ${{ runner.os }}-codeql-cache-${{ matrix.language }}-${{ matrix.codeql_cli }}-${{ github.run_id }} + restore-keys: | + ${{ runner.os }}-codeql-cache-${{ matrix.language }}-${{ matrix.codeql_cli }} + ${{ runner.os }}-codeql-cache-${{ matrix.language }} - name: Install CodeQL - if: steps.cache-codeql.outputs.cache-hit != 'true' uses: ./.github/actions/install-codeql with: codeql-cli-version: ${{ matrix.codeql_cli }} @@ -83,8 +81,7 @@ jobs: - name: Pre-Compile Queries id: pre-compile-queries run: | - ${{ github.workspace }}/codeql_home/codeql/codeql query compile --threads 0 ${{ matrix.language }} - + ${{ github.workspace }}/codeql_home/codeql/codeql query compile --threads 0 ${{ matrix.language }} - name: Run test suites id: run-test-suites From e8f3d850f13d765a61ccb5a6f5441041f1d01297 Mon Sep 17 00:00:00 2001 From: Mauro Baluda Date: Wed, 26 Aug 2026 22:37:25 +0200 Subject: [PATCH 18/38] Refactor CodeQL caching in workflow Updated caching strategy for CodeQL to use a new path and key format. --- .github/workflows/codeql_unit_tests.yml | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/.github/workflows/codeql_unit_tests.yml b/.github/workflows/codeql_unit_tests.yml index 400fe8d2ba..dc1069ab1c 100644 --- a/.github/workflows/codeql_unit_tests.yml +++ b/.github/workflows/codeql_unit_tests.yml @@ -57,15 +57,16 @@ jobs: run: pip install -r scripts/requirements.txt - name: Cache CodeQL + id: cache-codeql uses: actions/cache@v6 with: - path: ~/.codeql - key: ${{ runner.os }}-codeql-cache-${{ matrix.language }}-${{ matrix.codeql_cli }}-${{ github.run_id }} - restore-keys: | - ${{ runner.os }}-codeql-cache-${{ matrix.language }}-${{ matrix.codeql_cli }} - ${{ runner.os }}-codeql-cache-${{ matrix.language }} + # A list of files, directories, and wildcard patterns to cache and restore + path: ${{github.workspace}}/codeql_home + # An explicit key for restoring and saving the cache + key: codeql-home-${{matrix.os}}-${{matrix.codeql_cli}}-${{matrix.codeql_standard_library}} - name: Install CodeQL + if: steps.cache-codeql.outputs.cache-hit != 'true' uses: ./.github/actions/install-codeql with: codeql-cli-version: ${{ matrix.codeql_cli }} @@ -73,6 +74,13 @@ jobs: codeql-home: ${{ github.workspace }}/codeql_home add-to-path: false + - name: Cache codeql compilation + uses: actions/cache@v6 + with: + path: ~/.codeql + key: ${{ runner.os }}-codeql-compilation-${{ github.run_id }} + restore-keys: ${{ runner.os }}-codeql-compilation + - name: Install CodeQL packs uses: ./.github/actions/install-codeql-packs with: From 39aae50ba6f55ab61e4391b1356706b615205b60 Mon Sep 17 00:00:00 2001 From: Mauro Baluda Date: Thu, 27 Aug 2026 00:47:42 +0200 Subject: [PATCH 19/38] Rename cache step for clarity --- .github/workflows/codeql_unit_tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/codeql_unit_tests.yml b/.github/workflows/codeql_unit_tests.yml index dc1069ab1c..ca9f59efba 100644 --- a/.github/workflows/codeql_unit_tests.yml +++ b/.github/workflows/codeql_unit_tests.yml @@ -74,7 +74,7 @@ jobs: codeql-home: ${{ github.workspace }}/codeql_home add-to-path: false - - name: Cache codeql compilation + - name: Cache queries compilation uses: actions/cache@v6 with: path: ~/.codeql From 9f6b44ebf06c82d11d980ded04dd83c5f654d2dd Mon Sep 17 00:00:00 2001 From: Mauro Baluda Date: Thu, 27 Aug 2026 01:10:18 +0200 Subject: [PATCH 20/38] Static caching path --- .github/workflows/codeql_unit_tests.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/codeql_unit_tests.yml b/.github/workflows/codeql_unit_tests.yml index ca9f59efba..21f2061a96 100644 --- a/.github/workflows/codeql_unit_tests.yml +++ b/.github/workflows/codeql_unit_tests.yml @@ -77,7 +77,7 @@ jobs: - name: Cache queries compilation uses: actions/cache@v6 with: - path: ~/.codeql + path: ${{ github.workspace }}/codeql_cache key: ${{ runner.os }}-codeql-compilation-${{ github.run_id }} restore-keys: ${{ runner.os }}-codeql-compilation @@ -89,7 +89,10 @@ jobs: - name: Pre-Compile Queries id: pre-compile-queries run: | - ${{ github.workspace }}/codeql_home/codeql/codeql query compile --threads 0 ${{ matrix.language }} + ${{ github.workspace }}/codeql_home/codeql/codeql query compile \ + --common-caches=${{ github.workspace }}/codeql_cache \ + --threads 0 \ + ${{ matrix.language }} - name: Run test suites id: run-test-suites @@ -140,7 +143,7 @@ jobs: os.makedirs(os.path.dirname(test_report_path), exist_ok=True) test_report_file = open(test_report_path, 'w') files_to_close.append(test_report_file) - procs.append(subprocess.Popen([codeql_bin, "test", "run", "--failing-exitcode=122", f"--slice={slice}/{num_slices}", "--ram=2048", "--format=json", *test_roots], stdout=test_report_file, stderr=subprocess.PIPE)) + procs.append(subprocess.Popen([codeql_bin, "test", "run", "--common-caches=${{ github.workspace }}/codeql_cache", "--failing-exitcode=122", f"--slice={slice}/{num_slices}", "--ram=2048", "--format=json", *test_roots], stdout=test_report_file, stderr=subprocess.PIPE)) for p in procs: _, err = p.communicate() From 55349eed0c8bc9dcf8d621bdf7b63f152429bee5 Mon Sep 17 00:00:00 2001 From: Mauro Baluda Date: Thu, 27 Aug 2026 01:26:59 +0200 Subject: [PATCH 21/38] Add common caches support --- .github/actions/install-codeql-packs/action.yml | 9 ++++++++- .github/workflows/codeql_unit_tests.yml | 1 + scripts/install-packs.py | 3 +++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/actions/install-codeql-packs/action.yml b/.github/actions/install-codeql-packs/action.yml index 2e6d5f1a2e..3a60e47bb1 100644 --- a/.github/actions/install-codeql-packs/action.yml +++ b/.github/actions/install-codeql-packs/action.yml @@ -7,6 +7,11 @@ inputs: The path to the CodeQL CLI directory. required: false + common_caches: + description: | + The path to the CodeQL common caches directory. + required: false + mode: description: | The `--mode` option to `codeql pack install`. @@ -22,4 +27,6 @@ runs: CODEQL_CLI: ${{ inputs.cli_path }} run: | PATH=$PATH:$CODEQL_CLI - python scripts/install-packs.py --mode ${{ inputs.mode }} + python scripts/install-packs.py \ + --mode ${{ inputs.mode }} \ + --common-caches "${{ inputs.common_caches }}" diff --git a/.github/workflows/codeql_unit_tests.yml b/.github/workflows/codeql_unit_tests.yml index 21f2061a96..93bac6f96f 100644 --- a/.github/workflows/codeql_unit_tests.yml +++ b/.github/workflows/codeql_unit_tests.yml @@ -85,6 +85,7 @@ jobs: uses: ./.github/actions/install-codeql-packs with: cli_path: ${{ github.workspace }}/codeql_home/codeql + common_caches: ${{ github.workspace }}/codeql_cache - name: Pre-Compile Queries id: pre-compile-queries diff --git a/scripts/install-packs.py b/scripts/install-packs.py index ab45c32818..f9a703e1d3 100644 --- a/scripts/install-packs.py +++ b/scripts/install-packs.py @@ -6,6 +6,7 @@ parser = argparse.ArgumentParser(description="Install CodeQL library pack dependencies.") parser.add_argument('--mode', required=False, choices=['use-lock', 'update', 'verify', 'no-lock'], default="use-lock", help="Installation mode, identical to the `--mode` argument to `codeql pack install`") parser.add_argument('--codeql', required=False, default='codeql', help="Path to the `codeql` executable.") +parser.add_argument('--common-caches', required=False, help="Path to the CodeQL common caches directory.") args = parser.parse_args() # Find the root of the repo @@ -19,5 +20,7 @@ pack_path = os.path.join(root, pack) # Run `codeql pack install` to install dependencies. command = [args.codeql, 'pack', 'install', '--allow-prerelease', '--mode', args.mode, pack_path] + if args.common_caches: + command.insert(3, f'--common-caches={args.common_caches}') print(f'Running `{" ".join(command)}`') subprocess.check_call(command) From 5ff0ba8b8612db077ecc3b771a0719cb8574ded1 Mon Sep 17 00:00:00 2001 From: Mauro Baluda Date: Thu, 27 Aug 2026 02:03:53 +0200 Subject: [PATCH 22/38] Enhance CodeQL caching key to include language, CLI, and standard library --- .github/workflows/codeql_unit_tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/codeql_unit_tests.yml b/.github/workflows/codeql_unit_tests.yml index 93bac6f96f..eea96cbd85 100644 --- a/.github/workflows/codeql_unit_tests.yml +++ b/.github/workflows/codeql_unit_tests.yml @@ -78,8 +78,8 @@ jobs: uses: actions/cache@v6 with: path: ${{ github.workspace }}/codeql_cache - key: ${{ runner.os }}-codeql-compilation-${{ github.run_id }} - restore-keys: ${{ runner.os }}-codeql-compilation + key: ${{ runner.os }}-codeql-compilation-${{ matrix.language }}-${{ matrix.codeql_cli }}-${{ matrix.codeql_standard_library_ident }}-${{ github.run_id }} + restore-keys: ${{ runner.os }}-codeql-compilation-${{ matrix.language }}-${{ matrix.codeql_cli }}-${{ matrix.codeql_standard_library_ident }} - name: Install CodeQL packs uses: ./.github/actions/install-codeql-packs From 79de7b215b017677d9774eed7402c45e41438014 Mon Sep 17 00:00:00 2001 From: Mauro Baluda Date: Thu, 27 Aug 2026 10:51:56 +0200 Subject: [PATCH 23/38] Update codeql_unit_tests.yml --- .github/workflows/codeql_unit_tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/codeql_unit_tests.yml b/.github/workflows/codeql_unit_tests.yml index eea96cbd85..bda65e566c 100644 --- a/.github/workflows/codeql_unit_tests.yml +++ b/.github/workflows/codeql_unit_tests.yml @@ -17,6 +17,7 @@ on: - "rc/**" jobs: + prepare-unit-test-matrix: name: Prepare CodeQL unit test matrix runs-on: ubuntu-22.04 From 0af999085eb7e92ec8ff8ac3f9bbcea94db5734f Mon Sep 17 00:00:00 2001 From: Mauro Baluda Date: Thu, 27 Aug 2026 11:46:25 +0200 Subject: [PATCH 24/38] Add compilation cache size parameter --- .github/workflows/codeql_unit_tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/codeql_unit_tests.yml b/.github/workflows/codeql_unit_tests.yml index bda65e566c..0acb8818ec 100644 --- a/.github/workflows/codeql_unit_tests.yml +++ b/.github/workflows/codeql_unit_tests.yml @@ -17,7 +17,6 @@ on: - "rc/**" jobs: - prepare-unit-test-matrix: name: Prepare CodeQL unit test matrix runs-on: ubuntu-22.04 @@ -93,6 +92,7 @@ jobs: run: | ${{ github.workspace }}/codeql_home/codeql/codeql query compile \ --common-caches=${{ github.workspace }}/codeql_cache \ + --compilation-cache-size=1024 \ --threads 0 \ ${{ matrix.language }} From 464b00234298865b67b666e3dec2ae1090e1aaae Mon Sep 17 00:00:00 2001 From: Mauro Baluda Date: Thu, 27 Aug 2026 12:09:28 +0200 Subject: [PATCH 25/38] restore and save early queries compilation cache --- .github/workflows/codeql_unit_tests.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/codeql_unit_tests.yml b/.github/workflows/codeql_unit_tests.yml index 0acb8818ec..7b9966a7e7 100644 --- a/.github/workflows/codeql_unit_tests.yml +++ b/.github/workflows/codeql_unit_tests.yml @@ -75,7 +75,8 @@ jobs: add-to-path: false - name: Cache queries compilation - uses: actions/cache@v6 + id: cache-queries-compilation + uses: actions/cache/restore@v6 with: path: ${{ github.workspace }}/codeql_cache key: ${{ runner.os }}-codeql-compilation-${{ matrix.language }}-${{ matrix.codeql_cli }}-${{ matrix.codeql_standard_library_ident }}-${{ github.run_id }} @@ -96,6 +97,12 @@ jobs: --threads 0 \ ${{ matrix.language }} + - name: Save queries compilation cache + uses: actions/cache/save@v6 + with: + path: ${{ github.workspace }}/codeql_cache + key: ${{ steps.cache-queries-compilation.outputs.cache-primary-key }} + - name: Run test suites id: run-test-suites env: From 48f65a4de522db7472f345a9d6522d12a471b52f Mon Sep 17 00:00:00 2001 From: Mauro Baluda Date: Thu, 27 Aug 2026 12:59:54 +0200 Subject: [PATCH 26/38] format --- .github/workflows/codeql_unit_tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/codeql_unit_tests.yml b/.github/workflows/codeql_unit_tests.yml index 7b9966a7e7..8767bdbe07 100644 --- a/.github/workflows/codeql_unit_tests.yml +++ b/.github/workflows/codeql_unit_tests.yml @@ -17,6 +17,7 @@ on: - "rc/**" jobs: + prepare-unit-test-matrix: name: Prepare CodeQL unit test matrix runs-on: ubuntu-22.04 From 3076ee9dc0c92d8e369a18bb1b29044268fb19d7 Mon Sep 17 00:00:00 2001 From: Mauro Baluda Date: Thu, 27 Aug 2026 13:28:48 +0200 Subject: [PATCH 27/38] Add caching to the pack-gen workflow --- .github/workflows/code-scanning-pack-gen.yml | 22 +++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/.github/workflows/code-scanning-pack-gen.yml b/.github/workflows/code-scanning-pack-gen.yml index 295ef36f4c..3bf9628040 100644 --- a/.github/workflows/code-scanning-pack-gen.yml +++ b/.github/workflows/code-scanning-pack-gen.yml @@ -62,10 +62,19 @@ jobs: codeql-home: ${{ github.workspace }}/codeql_home add-to-path: false + - name: Cache queries compilation + id: cache-queries-compilation + uses: actions/cache/restore@v6 + with: + path: ${{ github.workspace }}/codeql_cache + key: ${{ runner.os }}-codeql-compilation-code-scanning-pack-${{ matrix.codeql_cli }}-${{ matrix.codeql_standard_library }}-${{ github.run_id }} + restore-keys: ${{ runner.os }}-codeql-compilation-code-scanning-pack-${{ matrix.codeql_cli }}-${{ matrix.codeql_standard_library }} + - name: Install CodeQL packs uses: ./.github/actions/install-codeql-packs with: cli_path: ${{ github.workspace }}/codeql_home/codeql + common_caches: ${{ github.workspace }}/codeql_cache - name: Determine ref for external help files id: determine-ref @@ -105,11 +114,22 @@ jobs: PATH=$PATH:$CODEQL_HOME/codeql # Precompile all queries, and use a compilation cache larger than default # to ensure we cache all the queries for later steps - codeql query compile --precompile --threads 0 --compilation-cache-size=1024 cpp c + codeql query compile \ + --common-caches=${{ github.workspace }}/codeql_cache \ + --precompile \ + --threads 0 \ + --compilation-cache-size=1024 \ + cpp c cd .. zip -r codeql-coding-standards/code-scanning-cpp-query-pack.zip codeql-coding-standards/c/ codeql-coding-standards/cpp/ codeql-coding-standards/.codeqlmanifest.json codeql-coding-standards/supported_codeql_configs.json codeql-coding-standards/scripts/configuration codeql-coding-standards/scripts/reports codeql-coding-standards/scripts/shared codeql-coding-standards/scripts/guideline_recategorization codeql-coding-standards/schemas + - name: Save queries compilation cache + uses: actions/cache/save@v6 + with: + path: ${{ github.workspace }}/codeql_cache + key: ${{ steps.cache-queries-compilation.outputs.cache-primary-key }} + - name: Upload GHAS Query Pack uses: actions/upload-artifact@v7 with: From 091492a0048cb2c36334b10c806bc2b322b90375 Mon Sep 17 00:00:00 2001 From: Mauro Baluda Date: Thu, 27 Aug 2026 15:15:16 +0200 Subject: [PATCH 28/38] include caching for bundle creation --- .github/workflows/code-scanning-pack-gen.yml | 20 ++++++++++---------- .github/workflows/codeql_unit_tests.yml | 1 - 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/.github/workflows/code-scanning-pack-gen.yml b/.github/workflows/code-scanning-pack-gen.yml index 3bf9628040..a880157d8f 100644 --- a/.github/workflows/code-scanning-pack-gen.yml +++ b/.github/workflows/code-scanning-pack-gen.yml @@ -20,7 +20,6 @@ env: XARGS_MAX_PROCS: 4 jobs: - prepare-code-scanning-pack-matrix: name: Prepare CodeQL Code Scanning pack matrix runs-on: ubuntu-22.04 @@ -139,20 +138,21 @@ jobs: - name: Create qlpack bundles env: CODEQL_HOME: ${{ github.workspace }}/codeql_home + CODEQL_CACHE: ${{ github.workspace }}/codeql_cache run: | PATH=$PATH:$CODEQL_HOME/codeql - codeql pack bundle --output=common-cpp-coding-standards.tgz cpp/common/src - codeql pack bundle --output=common-c-coding-standards.tgz c/common/src - codeql pack bundle --output=misra-c-coding-standards.tgz c/misra/src - codeql pack bundle --output=cert-c-coding-standards.tgz c/cert/src - codeql pack bundle --output=cert-cpp-coding-standards.tgz cpp/cert/src - codeql pack bundle --output=autosar-cpp-coding-standards.tgz cpp/autosar/src - codeql pack bundle --output=misra-cpp-coding-standards.tgz cpp/misra/src - codeql pack bundle --output=report-coding-standards.tgz cpp/report/src + codeql pack bundle --common-caches="$CODEQL_CACHE" --output=common-cpp-coding-standards.tgz cpp/common/src + codeql pack bundle --common-caches="$CODEQL_CACHE" --output=common-c-coding-standards.tgz c/common/src + codeql pack bundle --common-caches="$CODEQL_CACHE" --output=misra-c-coding-standards.tgz c/misra/src + codeql pack bundle --common-caches="$CODEQL_CACHE" --output=cert-c-coding-standards.tgz c/cert/src + codeql pack bundle --common-caches="$CODEQL_CACHE" --output=cert-cpp-coding-standards.tgz cpp/cert/src + codeql pack bundle --common-caches="$CODEQL_CACHE" --output=autosar-cpp-coding-standards.tgz cpp/autosar/src + codeql pack bundle --common-caches="$CODEQL_CACHE" --output=misra-cpp-coding-standards.tgz cpp/misra/src + codeql pack bundle --common-caches="$CODEQL_CACHE" --output=report-coding-standards.tgz cpp/report/src - name: Upload qlpack bundles uses: actions/upload-artifact@v7 with: name: coding-standards-codeql-packs - path: '*-coding-standards.tgz' \ No newline at end of file + path: "*-coding-standards.tgz" diff --git a/.github/workflows/codeql_unit_tests.yml b/.github/workflows/codeql_unit_tests.yml index 8767bdbe07..7b9966a7e7 100644 --- a/.github/workflows/codeql_unit_tests.yml +++ b/.github/workflows/codeql_unit_tests.yml @@ -17,7 +17,6 @@ on: - "rc/**" jobs: - prepare-unit-test-matrix: name: Prepare CodeQL unit test matrix runs-on: ubuntu-22.04 From a7abff32a0f283439310631767dad6e2fc692ada Mon Sep 17 00:00:00 2001 From: Jan Schlosser Date: Tue, 25 Aug 2026 10:02:57 +0200 Subject: [PATCH 29/38] Fix RULE-7-0-2 false positives: UnknownType and reference-to-bool dereference NoImplicitBoolConversion.ql flagged two systematic false-positive shapes: 1. Conversions whose source expression type could not be resolved to a concrete type (UnknownType). This occurs only in template-dependent contexts the extractor cannot resolve, e.g. a `constexpr bool` variable template initialized from another dependent variable template such as `std::conjunction_v<...>`, or a `noexcept(...)` specifier built the same way. 2. Reference-dereference conversions (`bool&`/`bool&&` -> `bool`). `getUnspecifiedType()` resolves typedefs/specifiers but does not strip reference qualification, so a `bool&`/`bool&&` is not recognised as already being `bool`. This is most commonly synthesized by the compiler for structured binding decomposition (`auto [a, b] = pair_or_tuple_expr;` where `b` is `bool`), which is not a real conversion since the referenced value is already a `bool`. This mirrors the same root-cause pattern already fixed for the sibling rule RULE-7-0-1 in 6f872c7c5 ("Fix RULE-7-0-1 false positives for bool-to- reference bindings"), applied here to the reverse conversion direction. --- ...p-rule-7-0-2-unknown-and-reference-bool.md | 13 +++++ .../RULE-7-0-2/NoImplicitBoolConversion.ql | 24 ++++++++ cpp/misra/test/rules/RULE-7-0-2/test.cpp | 55 +++++++++++++++++++ 3 files changed, 92 insertions(+) create mode 100644 change_notes/2026-08-25-fix-fp-rule-7-0-2-unknown-and-reference-bool.md diff --git a/change_notes/2026-08-25-fix-fp-rule-7-0-2-unknown-and-reference-bool.md b/change_notes/2026-08-25-fix-fp-rule-7-0-2-unknown-and-reference-bool.md new file mode 100644 index 0000000000..938f098d21 --- /dev/null +++ b/change_notes/2026-08-25-fix-fp-rule-7-0-2-unknown-and-reference-bool.md @@ -0,0 +1,13 @@ +- `RULE-7-0-2` - `NoImplicitBoolConversion.ql`: + - Fixed false positives where a conversion's source expression type could + not be resolved to a concrete type (`UnknownType`), which occurs only in + template-dependent contexts that the extractor cannot resolve, e.g. a + `constexpr bool` variable template whose initializer is itself another + dependent variable template such as `std::conjunction_v<...>`. + - Fixed false positives on reference-dereference conversions (`bool&`/ + `bool&&` to `bool`), which occur e.g. via the compiler-synthesized + `std::get(...)` call used to implement structured binding + decomposition (`auto [a, b] = some_pair_or_tuple_expr;` where `b` is + `bool`). Dereferencing a reference to `bool` does not change the type or + representation of the value, so this is not a conversion to `bool` in + the sense intended by the rule. diff --git a/cpp/misra/src/rules/RULE-7-0-2/NoImplicitBoolConversion.ql b/cpp/misra/src/rules/RULE-7-0-2/NoImplicitBoolConversion.ql index ae70b20259..cbf189d447 100644 --- a/cpp/misra/src/rules/RULE-7-0-2/NoImplicitBoolConversion.ql +++ b/cpp/misra/src/rules/RULE-7-0-2/NoImplicitBoolConversion.ql @@ -56,6 +56,30 @@ where e = conv and conv.getType().getUnspecifiedType() instanceof BoolType and not conv.getExpr().getType().getUnspecifiedType() instanceof BoolType and + // Exclude conversions whose source expression type could not be resolved to a concrete + // type (`UnknownType`). This shape occurs only in template-dependent contexts that the + // extractor has not (and, for uninstantiated templates, cannot) resolve to an actual type + // - e.g. a `constexpr bool` variable template / `noexcept(...)` specifier built from + // another variable template such as `std::conjunction_v<...>`. There is no actual, + // concrete conversion to `bool` that a developer wrote or that the compiler ultimately + // performs; flagging it produces a false positive because the "conversion from 'unknown'" + // is an artifact of incomplete extraction of template-dependent/library code, not a + // genuine violation. + not conv.getExpr().getType() instanceof UnknownType and + // Exclude reference-dereference conversions (`T& -> T` / `T&& -> T`) whose referenced type + // is itself `bool` once its reference-ness is stripped, e.g. the compiler-synthesized + // `std::get(...)` call used to implement structured binding decomposition + // (`auto [a, b] = some_pair_or_tuple_expr;` where `b` is `bool`). `getUnspecifiedType()` + // resolves typedefs/specifiers but does not strip reference qualification, so a `bool&`/ + // `bool&&` is not itself recognised as already being `bool` by the check above. But + // dereferencing a reference to `bool` does not represent a conversion from a different + // type to `bool` - the referenced value is already a `bool` - so this is not a violation. + not conv.getExpr() + .getType() + .getUnspecifiedType() + .(ReferenceType) + .getBaseType() + .getUnspecifiedType() instanceof BoolType and // Exception 2: Contextual conversion from pointer not ( isPointerType(conv.getExpr().getType()) and diff --git a/cpp/misra/test/rules/RULE-7-0-2/test.cpp b/cpp/misra/test/rules/RULE-7-0-2/test.cpp index 01e53c15e4..ce57597632 100644 --- a/cpp/misra/test/rules/RULE-7-0-2/test.cpp +++ b/cpp/misra/test/rules/RULE-7-0-2/test.cpp @@ -213,4 +213,59 @@ void test_member_function_pointer_conversion() { bool l3 = l1; // NON_COMPLIANT bool l4 = l2; // NON_COMPLIANT bool l5 = (l1 != nullptr); // COMPLIANT +} + +// Regression test for a false positive where the compiler-synthesized +// `get(...)` call used to implement structured binding decomposition (`auto +// [a, b] = ...;`) was incorrectly flagged as a "conversion to bool", even +// though the decomposed member is already `bool` - dereferencing a +// `bool&`/`bool&&` reference is not a conversion from another type to `bool`. +struct BoolPair { + std::int32_t first; + bool second; +}; + +template auto get(const BoolPair &p) { + if constexpr (I == 0) { + return p.first; + } else { + return p.second; + } +} + +namespace std { +template struct tuple_size; +template struct tuple_element; + +template <> struct tuple_size { + static constexpr std::size_t value = 2; +}; +template <> struct tuple_element<0, BoolPair> { using type = std::int32_t; }; +template <> struct tuple_element<1, BoolPair> { using type = bool; }; +} // namespace std + +BoolPair make_bool_pair(); + +void test_structured_binding_bool_decomposition() { + auto [l1, l2] = + make_bool_pair(); // COMPLIANT - structured binding decomposition, not a + // real conversion to bool + if (l2) { // COMPLIANT + } + bool l3 = l2; // COMPLIANT - l2 is already bool +} + +// Regression test for a false positive where a `constexpr bool` variable +// template, whose initializer is itself a dependent expression built from +// another variable template, was incorrectly flagged as a "conversion from +// 'unknown' to bool". The extractor cannot resolve a concrete type for a +// dependent, uninstantiated template expression, so it should not be treated as +// an actual conversion. +template constexpr bool is_something_v = true; + +template +constexpr bool derived_from_template_v = is_something_v; // COMPLIANT + +bool test_dependent_variable_template_instantiation() { + return derived_from_template_v; // COMPLIANT } \ No newline at end of file From 5c6c6aa56776435ad653d41cb5e6678baeb994f3 Mon Sep 17 00:00:00 2001 From: Mauro Baluda Date: Fri, 28 Aug 2026 11:02:30 +0200 Subject: [PATCH 30/38] Refactor EXP37-C rule to simplify function argument checks and improve performance --- ...tCallFunctionsWithIncompatibleArguments.ql | 11 ++++---- .../cpp/MistypedFunctionArguments.qll | 27 ++++++++++--------- 2 files changed, 20 insertions(+), 18 deletions(-) diff --git a/c/cert/src/rules/EXP37-C/DoNotCallFunctionsWithIncompatibleArguments.ql b/c/cert/src/rules/EXP37-C/DoNotCallFunctionsWithIncompatibleArguments.ql index 4c5ba57504..38e5ab8934 100644 --- a/c/cert/src/rules/EXP37-C/DoNotCallFunctionsWithIncompatibleArguments.ql +++ b/c/cert/src/rules/EXP37-C/DoNotCallFunctionsWithIncompatibleArguments.ql @@ -20,14 +20,15 @@ import cpp import codingstandards.c.cert import codingstandards.cpp.MistypedFunctionArguments -from FunctionCall fc, Function f, Parameter p +from FunctionCall fc, Parameter p where not isExcluded(fc, ExpressionsPackage::doNotCallFunctionsWithIncompatibleArgumentsQuery()) and + p = fc.getTarget().getAParameter() and ( - mistypedFunctionArguments(fc, f, p) + mistypedFunctionArguments(fc, p) or - complexArgumentPassedToRealParameter(fc, f, p) + complexArgumentPassedToRealParameter(fc, p) ) select fc, - "Argument $@ in call to " + f.toString() + " is incompatible with parameter " + p.getTypedName() + - ".", fc.getArgument(p.getIndex()) as arg, arg.toString() + "Argument $@ in " + fc.toString() + " is incompatible with parameter " + p.getTypedName() + ".", + fc.getArgument(p.getIndex()) as arg, arg.toString() diff --git a/cpp/common/src/codingstandards/cpp/MistypedFunctionArguments.qll b/cpp/common/src/codingstandards/cpp/MistypedFunctionArguments.qll index 6fe90372da..ecb4569a0f 100644 --- a/cpp/common/src/codingstandards/cpp/MistypedFunctionArguments.qll +++ b/cpp/common/src/codingstandards/cpp/MistypedFunctionArguments.qll @@ -91,21 +91,22 @@ private predicate isTypeInComplexDomain(FloatingPointType type) { type.getUnderlyingType().(FloatingPointType).getDomain() instanceof ComplexDomain } -predicate mistypedFunctionArguments(FunctionCall fc, Function f, Parameter p) { - f = fc.getTarget() and - p = f.getAParameter() and - hasZeroParamDecl(f) and - isCompiledAsC(f.getFile()) and - not f.isVarargs() and - not f instanceof BuiltInFunction and - p.getIndex() < fc.getNumberOfArguments() and - // Parameter p and its corresponding call argument must have mismatched types - not argMayBeUsed(fc.getArgument(p.getIndex()), p) +predicate mistypedFunctionArguments(FunctionCall fc, Parameter p) { + exists(Function f | + f = fc.getTarget() and + p = f.getAParameter() and + hasZeroParamDecl(f) and + isCompiledAsC(f.getFile()) and + not f.isVarargs() and + not f instanceof BuiltInFunction and + p.getIndex() < fc.getNumberOfArguments() and + // Parameter p and its corresponding call argument must have mismatched types + not argMayBeUsed(fc.getArgument(p.getIndex()), p) + ) } -predicate complexArgumentPassedToRealParameter(FunctionCall fc, Function f, Parameter p) { - f = fc.getTarget() and - p = f.getAParameter() and +predicate complexArgumentPassedToRealParameter(FunctionCall fc, Parameter p) { + p = fc.getTarget().getAParameter() and // Some implementations implicitly convert complex floating point values by // extracting the real part of the complex number (in-place or via a creal() call). // This predicate holds in those cases unless the value is explicitly converted. From 15c66a8b596cdead620445434815692929efa25a Mon Sep 17 00:00:00 2001 From: Mauro Baluda Date: Fri, 28 Aug 2026 11:15:14 +0200 Subject: [PATCH 31/38] change note --- change_notes/2026-08-28-improve-exp37-c-performance.md | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 change_notes/2026-08-28-improve-exp37-c-performance.md diff --git a/change_notes/2026-08-28-improve-exp37-c-performance.md b/change_notes/2026-08-28-improve-exp37-c-performance.md new file mode 100644 index 0000000000..65baded760 --- /dev/null +++ b/change_notes/2026-08-28-improve-exp37-c-performance.md @@ -0,0 +1,2 @@ +- `EXP37-C` - `DoNotCallFunctionsWithIncompatibleArguments.ql`: + - Improved query evaluation performance. Query results are unchanged. \ No newline at end of file From dc8d0aa7a1de869c2650d38afa292298655fae05 Mon Sep 17 00:00:00 2001 From: Mauro Baluda Date: Fri, 4 Sep 2026 19:40:44 +0200 Subject: [PATCH 32/38] Add exclusion check for header files in problems predicate --- .../cpp/rules/includeguardsnotused/IncludeGuardsNotUsed.qll | 1 + 1 file changed, 1 insertion(+) diff --git a/cpp/common/src/codingstandards/cpp/rules/includeguardsnotused/IncludeGuardsNotUsed.qll b/cpp/common/src/codingstandards/cpp/rules/includeguardsnotused/IncludeGuardsNotUsed.qll index f2e4fa277e..fefe57b319 100644 --- a/cpp/common/src/codingstandards/cpp/rules/includeguardsnotused/IncludeGuardsNotUsed.qll +++ b/cpp/common/src/codingstandards/cpp/rules/includeguardsnotused/IncludeGuardsNotUsed.qll @@ -24,6 +24,7 @@ class BlockedIncludeGuard extends HeaderFile { } query predicate problems(HeaderFile file, string message, HeaderFile other, string name) { + not isExcluded(file, getQuery()) and not file instanceof CorrectIncludeGuard and if file instanceof BlockedIncludeGuard then From eefd72a23c80ad0489e217f6873e7ff0e7579fe9 Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Fri, 4 Sep 2026 20:56:34 +0200 Subject: [PATCH 33/38] Add passing and failing tests for IncludeGuardsNotUsed exclusion check feedback (#1195) * Add passing/failing tests for IncludeGuardsNotUsed exclusion behavior --- .../includeguardsnotused/IncludeGuardsNotUsed.expected | 1 + .../headers/excluded/coding-standards.xml | 10 ++++++++++ .../headers/excluded/coding-standards.yml | 3 +++ .../includeguardsnotused/headers/excluded/test8.h | 2 ++ .../test/rules/includeguardsnotused/headers/test8.h | 2 ++ c/common/test/rules/includeguardsnotused/test.c | 6 +++++- .../includeguardsnotused/IncludeGuardsNotUsed.expected | 1 + .../headers/excluded/coding-standards.xml | 10 ++++++++++ .../headers/excluded/coding-standards.yml | 3 +++ .../includeguardsnotused/headers/excluded/test7.hpp | 2 ++ .../test/rules/includeguardsnotused/headers/test7.hpp | 2 ++ cpp/common/test/rules/includeguardsnotused/test.cpp | 6 +++++- 12 files changed, 46 insertions(+), 2 deletions(-) create mode 100644 c/common/test/rules/includeguardsnotused/headers/excluded/coding-standards.xml create mode 100644 c/common/test/rules/includeguardsnotused/headers/excluded/coding-standards.yml create mode 100644 c/common/test/rules/includeguardsnotused/headers/excluded/test8.h create mode 100644 c/common/test/rules/includeguardsnotused/headers/test8.h create mode 100644 cpp/common/test/rules/includeguardsnotused/headers/excluded/coding-standards.xml create mode 100644 cpp/common/test/rules/includeguardsnotused/headers/excluded/coding-standards.yml create mode 100644 cpp/common/test/rules/includeguardsnotused/headers/excluded/test7.hpp create mode 100644 cpp/common/test/rules/includeguardsnotused/headers/test7.hpp diff --git a/c/common/test/rules/includeguardsnotused/IncludeGuardsNotUsed.expected b/c/common/test/rules/includeguardsnotused/IncludeGuardsNotUsed.expected index 8d72392ed5..07d19e7cf3 100644 --- a/c/common/test/rules/includeguardsnotused/IncludeGuardsNotUsed.expected +++ b/c/common/test/rules/includeguardsnotused/IncludeGuardsNotUsed.expected @@ -2,3 +2,4 @@ | headers/test4.h:0:0:0:0 | headers/test4.h | Header file test4.h is missing expected include guard. | headers/test4.h:0:0:0:0 | headers/test4.h | | | headers/test5.h:0:0:0:0 | headers/test5.h | Header file test5.h is missing expected include guard. | headers/test5.h:0:0:0:0 | headers/test5.h | | | headers/test7.h:0:0:0:0 | headers/test7.h | Header file test7.h is never included by reusing the include guard used by $@. | headers/test6.h:0:0:0:0 | headers/test6.h | include guard | +| headers/test8.h:0:0:0:0 | headers/test8.h | Header file test8.h is missing expected include guard. | headers/test8.h:0:0:0:0 | headers/test8.h | | diff --git a/c/common/test/rules/includeguardsnotused/headers/excluded/coding-standards.xml b/c/common/test/rules/includeguardsnotused/headers/excluded/coding-standards.xml new file mode 100644 index 0000000000..adf7df0ce6 --- /dev/null +++ b/c/common/test/rules/includeguardsnotused/headers/excluded/coding-standards.xml @@ -0,0 +1,10 @@ + + + + + + cpp-test-dummy + This header is deliberately excluded to test the exclusion mechanism. + + + diff --git a/c/common/test/rules/includeguardsnotused/headers/excluded/coding-standards.yml b/c/common/test/rules/includeguardsnotused/headers/excluded/coding-standards.yml new file mode 100644 index 0000000000..d4ea695e26 --- /dev/null +++ b/c/common/test/rules/includeguardsnotused/headers/excluded/coding-standards.yml @@ -0,0 +1,3 @@ +deviations: + - rule-id: cpp-test-dummy + justification: This header is deliberately excluded to test the exclusion mechanism. diff --git a/c/common/test/rules/includeguardsnotused/headers/excluded/test8.h b/c/common/test/rules/includeguardsnotused/headers/excluded/test8.h new file mode 100644 index 0000000000..9d07b4b188 --- /dev/null +++ b/c/common/test/rules/includeguardsnotused/headers/excluded/test8.h @@ -0,0 +1,2 @@ +// COMPLIANT - excluded via deviation +int g7; diff --git a/c/common/test/rules/includeguardsnotused/headers/test8.h b/c/common/test/rules/includeguardsnotused/headers/test8.h new file mode 100644 index 0000000000..fc82ac2a01 --- /dev/null +++ b/c/common/test/rules/includeguardsnotused/headers/test8.h @@ -0,0 +1,2 @@ +// NON_COMPLIANT +int g6; diff --git a/c/common/test/rules/includeguardsnotused/test.c b/c/common/test/rules/includeguardsnotused/test.c index 8c63904fc4..15b066be14 100644 --- a/c/common/test/rules/includeguardsnotused/test.c +++ b/c/common/test/rules/includeguardsnotused/test.c @@ -11,4 +11,8 @@ #include "headers/test6.h" //NON_COMPLIANT - non unique and reported in alert for the next -#include "headers/test7.h" //NON_COMPLIANT - non unique \ No newline at end of file +#include "headers/test7.h" //NON_COMPLIANT - non unique + +#include "headers/test8.h" //NON_COMPLIANT - missing include guard, not excluded + +#include "headers/excluded/test8.h" //COMPLIANT - missing include guard, but excluded via deviation \ No newline at end of file diff --git a/cpp/common/test/rules/includeguardsnotused/IncludeGuardsNotUsed.expected b/cpp/common/test/rules/includeguardsnotused/IncludeGuardsNotUsed.expected index f915e37ec1..dda204cd18 100644 --- a/cpp/common/test/rules/includeguardsnotused/IncludeGuardsNotUsed.expected +++ b/cpp/common/test/rules/includeguardsnotused/IncludeGuardsNotUsed.expected @@ -2,3 +2,4 @@ | headers/test4.hpp:0:0:0:0 | headers/test4.hpp | Header file test4.hpp is missing expected include guard. | headers/test4.hpp:0:0:0:0 | headers/test4.hpp | | | headers/test5.hpp:0:0:0:0 | headers/test5.hpp | Header file test5.hpp is missing expected include guard. | headers/test5.hpp:0:0:0:0 | headers/test5.hpp | | | headers/test6.hpp:0:0:0:0 | headers/test6.hpp | Header file test6.hpp is missing expected include guard. | headers/test6.hpp:0:0:0:0 | headers/test6.hpp | | +| headers/test7.hpp:0:0:0:0 | headers/test7.hpp | Header file test7.hpp is missing expected include guard. | headers/test7.hpp:0:0:0:0 | headers/test7.hpp | | diff --git a/cpp/common/test/rules/includeguardsnotused/headers/excluded/coding-standards.xml b/cpp/common/test/rules/includeguardsnotused/headers/excluded/coding-standards.xml new file mode 100644 index 0000000000..adf7df0ce6 --- /dev/null +++ b/cpp/common/test/rules/includeguardsnotused/headers/excluded/coding-standards.xml @@ -0,0 +1,10 @@ + + + + + + cpp-test-dummy + This header is deliberately excluded to test the exclusion mechanism. + + + diff --git a/cpp/common/test/rules/includeguardsnotused/headers/excluded/coding-standards.yml b/cpp/common/test/rules/includeguardsnotused/headers/excluded/coding-standards.yml new file mode 100644 index 0000000000..d4ea695e26 --- /dev/null +++ b/cpp/common/test/rules/includeguardsnotused/headers/excluded/coding-standards.yml @@ -0,0 +1,3 @@ +deviations: + - rule-id: cpp-test-dummy + justification: This header is deliberately excluded to test the exclusion mechanism. diff --git a/cpp/common/test/rules/includeguardsnotused/headers/excluded/test7.hpp b/cpp/common/test/rules/includeguardsnotused/headers/excluded/test7.hpp new file mode 100644 index 0000000000..9d07b4b188 --- /dev/null +++ b/cpp/common/test/rules/includeguardsnotused/headers/excluded/test7.hpp @@ -0,0 +1,2 @@ +// COMPLIANT - excluded via deviation +int g7; diff --git a/cpp/common/test/rules/includeguardsnotused/headers/test7.hpp b/cpp/common/test/rules/includeguardsnotused/headers/test7.hpp new file mode 100644 index 0000000000..fc82ac2a01 --- /dev/null +++ b/cpp/common/test/rules/includeguardsnotused/headers/test7.hpp @@ -0,0 +1,2 @@ +// NON_COMPLIANT +int g6; diff --git a/cpp/common/test/rules/includeguardsnotused/test.cpp b/cpp/common/test/rules/includeguardsnotused/test.cpp index 356710eb5f..82170197f2 100644 --- a/cpp/common/test/rules/includeguardsnotused/test.cpp +++ b/cpp/common/test/rules/includeguardsnotused/test.cpp @@ -9,4 +9,8 @@ #include "headers/test5.hpp" //COMPLIANT - non unique precedes malformed -#include "headers/test6.hpp" //COMPLIANT - non unique \ No newline at end of file +#include "headers/test6.hpp" //COMPLIANT - non unique + +#include "headers/test7.hpp" //NON_COMPLIANT - missing include guard, not excluded + +#include "headers/excluded/test7.hpp" // COMPLIANT - excluded via deviation \ No newline at end of file From fe0a7c368d795c1b11d9c659e5f314a20c154034 Mon Sep 17 00:00:00 2001 From: Mauro Baluda Date: Fri, 4 Sep 2026 21:00:38 +0200 Subject: [PATCH 34/38] remove one duplicate test --- .../includeguardsnotused/IncludeGuardsNotUsed.expected | 1 - .../headers/excluded/coding-standards.xml | 10 ---------- .../headers/excluded/coding-standards.yml | 3 --- .../includeguardsnotused/headers/excluded/test8.h | 2 -- .../test/rules/includeguardsnotused/headers/test8.h | 2 -- c/common/test/rules/includeguardsnotused/test.c | 6 +----- 6 files changed, 1 insertion(+), 23 deletions(-) delete mode 100644 c/common/test/rules/includeguardsnotused/headers/excluded/coding-standards.xml delete mode 100644 c/common/test/rules/includeguardsnotused/headers/excluded/coding-standards.yml delete mode 100644 c/common/test/rules/includeguardsnotused/headers/excluded/test8.h delete mode 100644 c/common/test/rules/includeguardsnotused/headers/test8.h diff --git a/c/common/test/rules/includeguardsnotused/IncludeGuardsNotUsed.expected b/c/common/test/rules/includeguardsnotused/IncludeGuardsNotUsed.expected index 07d19e7cf3..8d72392ed5 100644 --- a/c/common/test/rules/includeguardsnotused/IncludeGuardsNotUsed.expected +++ b/c/common/test/rules/includeguardsnotused/IncludeGuardsNotUsed.expected @@ -2,4 +2,3 @@ | headers/test4.h:0:0:0:0 | headers/test4.h | Header file test4.h is missing expected include guard. | headers/test4.h:0:0:0:0 | headers/test4.h | | | headers/test5.h:0:0:0:0 | headers/test5.h | Header file test5.h is missing expected include guard. | headers/test5.h:0:0:0:0 | headers/test5.h | | | headers/test7.h:0:0:0:0 | headers/test7.h | Header file test7.h is never included by reusing the include guard used by $@. | headers/test6.h:0:0:0:0 | headers/test6.h | include guard | -| headers/test8.h:0:0:0:0 | headers/test8.h | Header file test8.h is missing expected include guard. | headers/test8.h:0:0:0:0 | headers/test8.h | | diff --git a/c/common/test/rules/includeguardsnotused/headers/excluded/coding-standards.xml b/c/common/test/rules/includeguardsnotused/headers/excluded/coding-standards.xml deleted file mode 100644 index adf7df0ce6..0000000000 --- a/c/common/test/rules/includeguardsnotused/headers/excluded/coding-standards.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - cpp-test-dummy - This header is deliberately excluded to test the exclusion mechanism. - - - diff --git a/c/common/test/rules/includeguardsnotused/headers/excluded/coding-standards.yml b/c/common/test/rules/includeguardsnotused/headers/excluded/coding-standards.yml deleted file mode 100644 index d4ea695e26..0000000000 --- a/c/common/test/rules/includeguardsnotused/headers/excluded/coding-standards.yml +++ /dev/null @@ -1,3 +0,0 @@ -deviations: - - rule-id: cpp-test-dummy - justification: This header is deliberately excluded to test the exclusion mechanism. diff --git a/c/common/test/rules/includeguardsnotused/headers/excluded/test8.h b/c/common/test/rules/includeguardsnotused/headers/excluded/test8.h deleted file mode 100644 index 9d07b4b188..0000000000 --- a/c/common/test/rules/includeguardsnotused/headers/excluded/test8.h +++ /dev/null @@ -1,2 +0,0 @@ -// COMPLIANT - excluded via deviation -int g7; diff --git a/c/common/test/rules/includeguardsnotused/headers/test8.h b/c/common/test/rules/includeguardsnotused/headers/test8.h deleted file mode 100644 index fc82ac2a01..0000000000 --- a/c/common/test/rules/includeguardsnotused/headers/test8.h +++ /dev/null @@ -1,2 +0,0 @@ -// NON_COMPLIANT -int g6; diff --git a/c/common/test/rules/includeguardsnotused/test.c b/c/common/test/rules/includeguardsnotused/test.c index 15b066be14..8c63904fc4 100644 --- a/c/common/test/rules/includeguardsnotused/test.c +++ b/c/common/test/rules/includeguardsnotused/test.c @@ -11,8 +11,4 @@ #include "headers/test6.h" //NON_COMPLIANT - non unique and reported in alert for the next -#include "headers/test7.h" //NON_COMPLIANT - non unique - -#include "headers/test8.h" //NON_COMPLIANT - missing include guard, not excluded - -#include "headers/excluded/test8.h" //COMPLIANT - missing include guard, but excluded via deviation \ No newline at end of file +#include "headers/test7.h" //NON_COMPLIANT - non unique \ No newline at end of file From 5b0f53fd8ae73683bb365c5317c8d2baea95fc00 Mon Sep 17 00:00:00 2001 From: Mauro Baluda Date: Fri, 4 Sep 2026 23:44:10 +0200 Subject: [PATCH 35/38] Add change note --- .../2026-09-04-add-exclusion-check-for-include-guards.md | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 change_notes/2026-09-04-add-exclusion-check-for-include-guards.md diff --git a/change_notes/2026-09-04-add-exclusion-check-for-include-guards.md b/change_notes/2026-09-04-add-exclusion-check-for-include-guards.md new file mode 100644 index 0000000000..ff25ef3480 --- /dev/null +++ b/change_notes/2026-09-04-add-exclusion-check-for-include-guards.md @@ -0,0 +1,2 @@ +- `DIR-4-10`, `M16-2-3`, and `RULE-19-2-1`: + - Header files matched by a configured exclusion are no longer reported. \ No newline at end of file From a526810e988441c2e905773170a0b5c9a16bad3a Mon Sep 17 00:00:00 2001 From: MichaelRFairhurst <1627771+MichaelRFairhurst@users.noreply.github.com> Date: Sat, 19 Sep 2026 18:44:33 +0000 Subject: [PATCH 36/38] Upgrading `github/codeql` dependency to 2.25.6 --- c/cert/src/codeql-pack.lock.yml | 24 +++++++++---------- c/cert/src/qlpack.yml | 2 +- c/cert/test/codeql-pack.lock.yml | 24 +++++++++---------- c/common/src/codeql-pack.lock.yml | 24 +++++++++---------- c/common/src/qlpack.yml | 2 +- c/common/test/codeql-pack.lock.yml | 24 +++++++++---------- c/misra/src/codeql-pack.lock.yml | 24 +++++++++---------- c/misra/src/qlpack.yml | 2 +- c/misra/test/codeql-pack.lock.yml | 24 +++++++++---------- cpp/autosar/src/codeql-pack.lock.yml | 24 +++++++++---------- cpp/autosar/src/qlpack.yml | 2 +- cpp/autosar/test/codeql-pack.lock.yml | 24 +++++++++---------- cpp/cert/src/codeql-pack.lock.yml | 24 +++++++++---------- cpp/cert/src/qlpack.yml | 2 +- cpp/cert/test/codeql-pack.lock.yml | 24 +++++++++---------- cpp/common/src/codeql-pack.lock.yml | 24 +++++++++---------- cpp/common/src/qlpack.yml | 2 +- cpp/common/test/codeql-pack.lock.yml | 24 +++++++++---------- cpp/misra/src/codeql-pack.lock.yml | 24 +++++++++---------- cpp/misra/src/qlpack.yml | 2 +- cpp/misra/test/codeql-pack.lock.yml | 24 +++++++++---------- cpp/report/src/codeql-pack.lock.yml | 24 +++++++++---------- cpp/report/src/qlpack.yml | 2 +- .../queries/codeql-pack.lock.yml | 24 +++++++++---------- scripts/generate_modules/queries/qlpack.yml | 2 +- supported_codeql_configs.json | 6 ++--- 26 files changed, 204 insertions(+), 204 deletions(-) diff --git a/c/cert/src/codeql-pack.lock.yml b/c/cert/src/codeql-pack.lock.yml index 10141cdc81..4f6d0f0455 100644 --- a/c/cert/src/codeql-pack.lock.yml +++ b/c/cert/src/codeql-pack.lock.yml @@ -4,27 +4,27 @@ dependencies: advanced-security/qtil: version: 0.0.3 codeql/controlflow: - version: 2.0.23 + version: 2.0.35 codeql/cpp-all: - version: 6.1.4 + version: 10.2.0 codeql/dataflow: - version: 2.0.23 + version: 2.1.7 codeql/mad: - version: 1.0.39 + version: 1.0.51 codeql/quantum: - version: 0.0.17 + version: 0.0.29 codeql/rangeanalysis: - version: 1.0.39 + version: 1.0.51 codeql/ssa: - version: 2.0.15 + version: 2.0.27 codeql/tutorial: - version: 1.0.39 + version: 1.0.51 codeql/typeflow: - version: 1.0.39 + version: 1.0.51 codeql/typetracking: - version: 2.0.23 + version: 2.0.35 codeql/util: - version: 2.0.26 + version: 2.0.38 codeql/xml: - version: 1.0.39 + version: 1.0.51 compiled: false diff --git a/c/cert/src/qlpack.yml b/c/cert/src/qlpack.yml index 986198651f..835d3a312c 100644 --- a/c/cert/src/qlpack.yml +++ b/c/cert/src/qlpack.yml @@ -6,4 +6,4 @@ license: MIT default-suite-file: codeql-suites/cert-c-default.qls dependencies: codeql/common-c-coding-standards: '*' - codeql/cpp-all: 6.1.4 + codeql/cpp-all: 10.2.0 diff --git a/c/cert/test/codeql-pack.lock.yml b/c/cert/test/codeql-pack.lock.yml index 10141cdc81..4f6d0f0455 100644 --- a/c/cert/test/codeql-pack.lock.yml +++ b/c/cert/test/codeql-pack.lock.yml @@ -4,27 +4,27 @@ dependencies: advanced-security/qtil: version: 0.0.3 codeql/controlflow: - version: 2.0.23 + version: 2.0.35 codeql/cpp-all: - version: 6.1.4 + version: 10.2.0 codeql/dataflow: - version: 2.0.23 + version: 2.1.7 codeql/mad: - version: 1.0.39 + version: 1.0.51 codeql/quantum: - version: 0.0.17 + version: 0.0.29 codeql/rangeanalysis: - version: 1.0.39 + version: 1.0.51 codeql/ssa: - version: 2.0.15 + version: 2.0.27 codeql/tutorial: - version: 1.0.39 + version: 1.0.51 codeql/typeflow: - version: 1.0.39 + version: 1.0.51 codeql/typetracking: - version: 2.0.23 + version: 2.0.35 codeql/util: - version: 2.0.26 + version: 2.0.38 codeql/xml: - version: 1.0.39 + version: 1.0.51 compiled: false diff --git a/c/common/src/codeql-pack.lock.yml b/c/common/src/codeql-pack.lock.yml index 10141cdc81..4f6d0f0455 100644 --- a/c/common/src/codeql-pack.lock.yml +++ b/c/common/src/codeql-pack.lock.yml @@ -4,27 +4,27 @@ dependencies: advanced-security/qtil: version: 0.0.3 codeql/controlflow: - version: 2.0.23 + version: 2.0.35 codeql/cpp-all: - version: 6.1.4 + version: 10.2.0 codeql/dataflow: - version: 2.0.23 + version: 2.1.7 codeql/mad: - version: 1.0.39 + version: 1.0.51 codeql/quantum: - version: 0.0.17 + version: 0.0.29 codeql/rangeanalysis: - version: 1.0.39 + version: 1.0.51 codeql/ssa: - version: 2.0.15 + version: 2.0.27 codeql/tutorial: - version: 1.0.39 + version: 1.0.51 codeql/typeflow: - version: 1.0.39 + version: 1.0.51 codeql/typetracking: - version: 2.0.23 + version: 2.0.35 codeql/util: - version: 2.0.26 + version: 2.0.38 codeql/xml: - version: 1.0.39 + version: 1.0.51 compiled: false diff --git a/c/common/src/qlpack.yml b/c/common/src/qlpack.yml index 7d84dfdcda..a5ae5314fe 100644 --- a/c/common/src/qlpack.yml +++ b/c/common/src/qlpack.yml @@ -3,4 +3,4 @@ version: 2.63.0-dev license: MIT dependencies: codeql/common-cpp-coding-standards: '*' - codeql/cpp-all: 6.1.4 + codeql/cpp-all: 10.2.0 diff --git a/c/common/test/codeql-pack.lock.yml b/c/common/test/codeql-pack.lock.yml index 10141cdc81..4f6d0f0455 100644 --- a/c/common/test/codeql-pack.lock.yml +++ b/c/common/test/codeql-pack.lock.yml @@ -4,27 +4,27 @@ dependencies: advanced-security/qtil: version: 0.0.3 codeql/controlflow: - version: 2.0.23 + version: 2.0.35 codeql/cpp-all: - version: 6.1.4 + version: 10.2.0 codeql/dataflow: - version: 2.0.23 + version: 2.1.7 codeql/mad: - version: 1.0.39 + version: 1.0.51 codeql/quantum: - version: 0.0.17 + version: 0.0.29 codeql/rangeanalysis: - version: 1.0.39 + version: 1.0.51 codeql/ssa: - version: 2.0.15 + version: 2.0.27 codeql/tutorial: - version: 1.0.39 + version: 1.0.51 codeql/typeflow: - version: 1.0.39 + version: 1.0.51 codeql/typetracking: - version: 2.0.23 + version: 2.0.35 codeql/util: - version: 2.0.26 + version: 2.0.38 codeql/xml: - version: 1.0.39 + version: 1.0.51 compiled: false diff --git a/c/misra/src/codeql-pack.lock.yml b/c/misra/src/codeql-pack.lock.yml index 10141cdc81..4f6d0f0455 100644 --- a/c/misra/src/codeql-pack.lock.yml +++ b/c/misra/src/codeql-pack.lock.yml @@ -4,27 +4,27 @@ dependencies: advanced-security/qtil: version: 0.0.3 codeql/controlflow: - version: 2.0.23 + version: 2.0.35 codeql/cpp-all: - version: 6.1.4 + version: 10.2.0 codeql/dataflow: - version: 2.0.23 + version: 2.1.7 codeql/mad: - version: 1.0.39 + version: 1.0.51 codeql/quantum: - version: 0.0.17 + version: 0.0.29 codeql/rangeanalysis: - version: 1.0.39 + version: 1.0.51 codeql/ssa: - version: 2.0.15 + version: 2.0.27 codeql/tutorial: - version: 1.0.39 + version: 1.0.51 codeql/typeflow: - version: 1.0.39 + version: 1.0.51 codeql/typetracking: - version: 2.0.23 + version: 2.0.35 codeql/util: - version: 2.0.26 + version: 2.0.38 codeql/xml: - version: 1.0.39 + version: 1.0.51 compiled: false diff --git a/c/misra/src/qlpack.yml b/c/misra/src/qlpack.yml index 2159caad47..2ccfa8bc4c 100644 --- a/c/misra/src/qlpack.yml +++ b/c/misra/src/qlpack.yml @@ -6,4 +6,4 @@ license: MIT default-suite-file: codeql-suites/misra-c-default.qls dependencies: codeql/common-c-coding-standards: '*' - codeql/cpp-all: 6.1.4 + codeql/cpp-all: 10.2.0 diff --git a/c/misra/test/codeql-pack.lock.yml b/c/misra/test/codeql-pack.lock.yml index 10141cdc81..4f6d0f0455 100644 --- a/c/misra/test/codeql-pack.lock.yml +++ b/c/misra/test/codeql-pack.lock.yml @@ -4,27 +4,27 @@ dependencies: advanced-security/qtil: version: 0.0.3 codeql/controlflow: - version: 2.0.23 + version: 2.0.35 codeql/cpp-all: - version: 6.1.4 + version: 10.2.0 codeql/dataflow: - version: 2.0.23 + version: 2.1.7 codeql/mad: - version: 1.0.39 + version: 1.0.51 codeql/quantum: - version: 0.0.17 + version: 0.0.29 codeql/rangeanalysis: - version: 1.0.39 + version: 1.0.51 codeql/ssa: - version: 2.0.15 + version: 2.0.27 codeql/tutorial: - version: 1.0.39 + version: 1.0.51 codeql/typeflow: - version: 1.0.39 + version: 1.0.51 codeql/typetracking: - version: 2.0.23 + version: 2.0.35 codeql/util: - version: 2.0.26 + version: 2.0.38 codeql/xml: - version: 1.0.39 + version: 1.0.51 compiled: false diff --git a/cpp/autosar/src/codeql-pack.lock.yml b/cpp/autosar/src/codeql-pack.lock.yml index 10141cdc81..4f6d0f0455 100644 --- a/cpp/autosar/src/codeql-pack.lock.yml +++ b/cpp/autosar/src/codeql-pack.lock.yml @@ -4,27 +4,27 @@ dependencies: advanced-security/qtil: version: 0.0.3 codeql/controlflow: - version: 2.0.23 + version: 2.0.35 codeql/cpp-all: - version: 6.1.4 + version: 10.2.0 codeql/dataflow: - version: 2.0.23 + version: 2.1.7 codeql/mad: - version: 1.0.39 + version: 1.0.51 codeql/quantum: - version: 0.0.17 + version: 0.0.29 codeql/rangeanalysis: - version: 1.0.39 + version: 1.0.51 codeql/ssa: - version: 2.0.15 + version: 2.0.27 codeql/tutorial: - version: 1.0.39 + version: 1.0.51 codeql/typeflow: - version: 1.0.39 + version: 1.0.51 codeql/typetracking: - version: 2.0.23 + version: 2.0.35 codeql/util: - version: 2.0.26 + version: 2.0.38 codeql/xml: - version: 1.0.39 + version: 1.0.51 compiled: false diff --git a/cpp/autosar/src/qlpack.yml b/cpp/autosar/src/qlpack.yml index 59f77dea66..c8197e1455 100644 --- a/cpp/autosar/src/qlpack.yml +++ b/cpp/autosar/src/qlpack.yml @@ -5,4 +5,4 @@ suites: codeql-suites license: MIT dependencies: codeql/common-cpp-coding-standards: '*' - codeql/cpp-all: 6.1.4 + codeql/cpp-all: 10.2.0 diff --git a/cpp/autosar/test/codeql-pack.lock.yml b/cpp/autosar/test/codeql-pack.lock.yml index 10141cdc81..4f6d0f0455 100644 --- a/cpp/autosar/test/codeql-pack.lock.yml +++ b/cpp/autosar/test/codeql-pack.lock.yml @@ -4,27 +4,27 @@ dependencies: advanced-security/qtil: version: 0.0.3 codeql/controlflow: - version: 2.0.23 + version: 2.0.35 codeql/cpp-all: - version: 6.1.4 + version: 10.2.0 codeql/dataflow: - version: 2.0.23 + version: 2.1.7 codeql/mad: - version: 1.0.39 + version: 1.0.51 codeql/quantum: - version: 0.0.17 + version: 0.0.29 codeql/rangeanalysis: - version: 1.0.39 + version: 1.0.51 codeql/ssa: - version: 2.0.15 + version: 2.0.27 codeql/tutorial: - version: 1.0.39 + version: 1.0.51 codeql/typeflow: - version: 1.0.39 + version: 1.0.51 codeql/typetracking: - version: 2.0.23 + version: 2.0.35 codeql/util: - version: 2.0.26 + version: 2.0.38 codeql/xml: - version: 1.0.39 + version: 1.0.51 compiled: false diff --git a/cpp/cert/src/codeql-pack.lock.yml b/cpp/cert/src/codeql-pack.lock.yml index 10141cdc81..4f6d0f0455 100644 --- a/cpp/cert/src/codeql-pack.lock.yml +++ b/cpp/cert/src/codeql-pack.lock.yml @@ -4,27 +4,27 @@ dependencies: advanced-security/qtil: version: 0.0.3 codeql/controlflow: - version: 2.0.23 + version: 2.0.35 codeql/cpp-all: - version: 6.1.4 + version: 10.2.0 codeql/dataflow: - version: 2.0.23 + version: 2.1.7 codeql/mad: - version: 1.0.39 + version: 1.0.51 codeql/quantum: - version: 0.0.17 + version: 0.0.29 codeql/rangeanalysis: - version: 1.0.39 + version: 1.0.51 codeql/ssa: - version: 2.0.15 + version: 2.0.27 codeql/tutorial: - version: 1.0.39 + version: 1.0.51 codeql/typeflow: - version: 1.0.39 + version: 1.0.51 codeql/typetracking: - version: 2.0.23 + version: 2.0.35 codeql/util: - version: 2.0.26 + version: 2.0.38 codeql/xml: - version: 1.0.39 + version: 1.0.51 compiled: false diff --git a/cpp/cert/src/qlpack.yml b/cpp/cert/src/qlpack.yml index 4d82d45fb6..38c9e3c371 100644 --- a/cpp/cert/src/qlpack.yml +++ b/cpp/cert/src/qlpack.yml @@ -5,5 +5,5 @@ suites: codeql-suites license: MIT default-suite-file: codeql-suites/cert-cpp-default.qls dependencies: - codeql/cpp-all: 6.1.4 + codeql/cpp-all: 10.2.0 codeql/common-cpp-coding-standards: '*' diff --git a/cpp/cert/test/codeql-pack.lock.yml b/cpp/cert/test/codeql-pack.lock.yml index 10141cdc81..4f6d0f0455 100644 --- a/cpp/cert/test/codeql-pack.lock.yml +++ b/cpp/cert/test/codeql-pack.lock.yml @@ -4,27 +4,27 @@ dependencies: advanced-security/qtil: version: 0.0.3 codeql/controlflow: - version: 2.0.23 + version: 2.0.35 codeql/cpp-all: - version: 6.1.4 + version: 10.2.0 codeql/dataflow: - version: 2.0.23 + version: 2.1.7 codeql/mad: - version: 1.0.39 + version: 1.0.51 codeql/quantum: - version: 0.0.17 + version: 0.0.29 codeql/rangeanalysis: - version: 1.0.39 + version: 1.0.51 codeql/ssa: - version: 2.0.15 + version: 2.0.27 codeql/tutorial: - version: 1.0.39 + version: 1.0.51 codeql/typeflow: - version: 1.0.39 + version: 1.0.51 codeql/typetracking: - version: 2.0.23 + version: 2.0.35 codeql/util: - version: 2.0.26 + version: 2.0.38 codeql/xml: - version: 1.0.39 + version: 1.0.51 compiled: false diff --git a/cpp/common/src/codeql-pack.lock.yml b/cpp/common/src/codeql-pack.lock.yml index 10141cdc81..4f6d0f0455 100644 --- a/cpp/common/src/codeql-pack.lock.yml +++ b/cpp/common/src/codeql-pack.lock.yml @@ -4,27 +4,27 @@ dependencies: advanced-security/qtil: version: 0.0.3 codeql/controlflow: - version: 2.0.23 + version: 2.0.35 codeql/cpp-all: - version: 6.1.4 + version: 10.2.0 codeql/dataflow: - version: 2.0.23 + version: 2.1.7 codeql/mad: - version: 1.0.39 + version: 1.0.51 codeql/quantum: - version: 0.0.17 + version: 0.0.29 codeql/rangeanalysis: - version: 1.0.39 + version: 1.0.51 codeql/ssa: - version: 2.0.15 + version: 2.0.27 codeql/tutorial: - version: 1.0.39 + version: 1.0.51 codeql/typeflow: - version: 1.0.39 + version: 1.0.51 codeql/typetracking: - version: 2.0.23 + version: 2.0.35 codeql/util: - version: 2.0.26 + version: 2.0.38 codeql/xml: - version: 1.0.39 + version: 1.0.51 compiled: false diff --git a/cpp/common/src/qlpack.yml b/cpp/common/src/qlpack.yml index fd44b461ca..3ccaafffbd 100644 --- a/cpp/common/src/qlpack.yml +++ b/cpp/common/src/qlpack.yml @@ -2,7 +2,7 @@ name: codeql/common-cpp-coding-standards version: 2.63.0-dev license: MIT dependencies: - codeql/cpp-all: 6.1.4 + codeql/cpp-all: 10.2.0 advanced-security/qtil: 0.0.3 dataExtensions: - ext/*.model.yml diff --git a/cpp/common/test/codeql-pack.lock.yml b/cpp/common/test/codeql-pack.lock.yml index 10141cdc81..4f6d0f0455 100644 --- a/cpp/common/test/codeql-pack.lock.yml +++ b/cpp/common/test/codeql-pack.lock.yml @@ -4,27 +4,27 @@ dependencies: advanced-security/qtil: version: 0.0.3 codeql/controlflow: - version: 2.0.23 + version: 2.0.35 codeql/cpp-all: - version: 6.1.4 + version: 10.2.0 codeql/dataflow: - version: 2.0.23 + version: 2.1.7 codeql/mad: - version: 1.0.39 + version: 1.0.51 codeql/quantum: - version: 0.0.17 + version: 0.0.29 codeql/rangeanalysis: - version: 1.0.39 + version: 1.0.51 codeql/ssa: - version: 2.0.15 + version: 2.0.27 codeql/tutorial: - version: 1.0.39 + version: 1.0.51 codeql/typeflow: - version: 1.0.39 + version: 1.0.51 codeql/typetracking: - version: 2.0.23 + version: 2.0.35 codeql/util: - version: 2.0.26 + version: 2.0.38 codeql/xml: - version: 1.0.39 + version: 1.0.51 compiled: false diff --git a/cpp/misra/src/codeql-pack.lock.yml b/cpp/misra/src/codeql-pack.lock.yml index 10141cdc81..4f6d0f0455 100644 --- a/cpp/misra/src/codeql-pack.lock.yml +++ b/cpp/misra/src/codeql-pack.lock.yml @@ -4,27 +4,27 @@ dependencies: advanced-security/qtil: version: 0.0.3 codeql/controlflow: - version: 2.0.23 + version: 2.0.35 codeql/cpp-all: - version: 6.1.4 + version: 10.2.0 codeql/dataflow: - version: 2.0.23 + version: 2.1.7 codeql/mad: - version: 1.0.39 + version: 1.0.51 codeql/quantum: - version: 0.0.17 + version: 0.0.29 codeql/rangeanalysis: - version: 1.0.39 + version: 1.0.51 codeql/ssa: - version: 2.0.15 + version: 2.0.27 codeql/tutorial: - version: 1.0.39 + version: 1.0.51 codeql/typeflow: - version: 1.0.39 + version: 1.0.51 codeql/typetracking: - version: 2.0.23 + version: 2.0.35 codeql/util: - version: 2.0.26 + version: 2.0.38 codeql/xml: - version: 1.0.39 + version: 1.0.51 compiled: false diff --git a/cpp/misra/src/qlpack.yml b/cpp/misra/src/qlpack.yml index 538f0d91fe..122369ce1f 100644 --- a/cpp/misra/src/qlpack.yml +++ b/cpp/misra/src/qlpack.yml @@ -5,5 +5,5 @@ default-suite: codeql-suites/misra-cpp-default.qls license: MIT dependencies: codeql/common-cpp-coding-standards: '*' - codeql/cpp-all: 6.1.4 + codeql/cpp-all: 10.2.0 advanced-security/qtil: 0.0.3 diff --git a/cpp/misra/test/codeql-pack.lock.yml b/cpp/misra/test/codeql-pack.lock.yml index 10141cdc81..4f6d0f0455 100644 --- a/cpp/misra/test/codeql-pack.lock.yml +++ b/cpp/misra/test/codeql-pack.lock.yml @@ -4,27 +4,27 @@ dependencies: advanced-security/qtil: version: 0.0.3 codeql/controlflow: - version: 2.0.23 + version: 2.0.35 codeql/cpp-all: - version: 6.1.4 + version: 10.2.0 codeql/dataflow: - version: 2.0.23 + version: 2.1.7 codeql/mad: - version: 1.0.39 + version: 1.0.51 codeql/quantum: - version: 0.0.17 + version: 0.0.29 codeql/rangeanalysis: - version: 1.0.39 + version: 1.0.51 codeql/ssa: - version: 2.0.15 + version: 2.0.27 codeql/tutorial: - version: 1.0.39 + version: 1.0.51 codeql/typeflow: - version: 1.0.39 + version: 1.0.51 codeql/typetracking: - version: 2.0.23 + version: 2.0.35 codeql/util: - version: 2.0.26 + version: 2.0.38 codeql/xml: - version: 1.0.39 + version: 1.0.51 compiled: false diff --git a/cpp/report/src/codeql-pack.lock.yml b/cpp/report/src/codeql-pack.lock.yml index bde92c18ab..86c8018c49 100644 --- a/cpp/report/src/codeql-pack.lock.yml +++ b/cpp/report/src/codeql-pack.lock.yml @@ -2,27 +2,27 @@ lockVersion: 1.0.0 dependencies: codeql/controlflow: - version: 2.0.23 + version: 2.0.35 codeql/cpp-all: - version: 6.1.4 + version: 10.2.0 codeql/dataflow: - version: 2.0.23 + version: 2.1.7 codeql/mad: - version: 1.0.39 + version: 1.0.51 codeql/quantum: - version: 0.0.17 + version: 0.0.29 codeql/rangeanalysis: - version: 1.0.39 + version: 1.0.51 codeql/ssa: - version: 2.0.15 + version: 2.0.27 codeql/tutorial: - version: 1.0.39 + version: 1.0.51 codeql/typeflow: - version: 1.0.39 + version: 1.0.51 codeql/typetracking: - version: 2.0.23 + version: 2.0.35 codeql/util: - version: 2.0.26 + version: 2.0.38 codeql/xml: - version: 1.0.39 + version: 1.0.51 compiled: false diff --git a/cpp/report/src/qlpack.yml b/cpp/report/src/qlpack.yml index 90b5f2b7a6..b1e2392b0f 100644 --- a/cpp/report/src/qlpack.yml +++ b/cpp/report/src/qlpack.yml @@ -2,4 +2,4 @@ name: codeql/report-cpp-coding-standards version: 2.63.0-dev license: MIT dependencies: - codeql/cpp-all: 6.1.4 + codeql/cpp-all: 10.2.0 diff --git a/scripts/generate_modules/queries/codeql-pack.lock.yml b/scripts/generate_modules/queries/codeql-pack.lock.yml index bde92c18ab..86c8018c49 100644 --- a/scripts/generate_modules/queries/codeql-pack.lock.yml +++ b/scripts/generate_modules/queries/codeql-pack.lock.yml @@ -2,27 +2,27 @@ lockVersion: 1.0.0 dependencies: codeql/controlflow: - version: 2.0.23 + version: 2.0.35 codeql/cpp-all: - version: 6.1.4 + version: 10.2.0 codeql/dataflow: - version: 2.0.23 + version: 2.1.7 codeql/mad: - version: 1.0.39 + version: 1.0.51 codeql/quantum: - version: 0.0.17 + version: 0.0.29 codeql/rangeanalysis: - version: 1.0.39 + version: 1.0.51 codeql/ssa: - version: 2.0.15 + version: 2.0.27 codeql/tutorial: - version: 1.0.39 + version: 1.0.51 codeql/typeflow: - version: 1.0.39 + version: 1.0.51 codeql/typetracking: - version: 2.0.23 + version: 2.0.35 codeql/util: - version: 2.0.26 + version: 2.0.38 codeql/xml: - version: 1.0.39 + version: 1.0.51 compiled: false diff --git a/scripts/generate_modules/queries/qlpack.yml b/scripts/generate_modules/queries/qlpack.yml index d57b21844b..692a7de500 100644 --- a/scripts/generate_modules/queries/qlpack.yml +++ b/scripts/generate_modules/queries/qlpack.yml @@ -2,4 +2,4 @@ name: codeql/standard-library-extraction-cpp-coding-standards version: 0.0.0 license: MIT dependencies: - codeql/cpp-all: 6.1.4 + codeql/cpp-all: 10.2.0 diff --git a/supported_codeql_configs.json b/supported_codeql_configs.json index 462b4925ef..10e1a29f9d 100644 --- a/supported_codeql_configs.json +++ b/supported_codeql_configs.json @@ -1,9 +1,9 @@ { "supported_environment": [ { - "codeql_cli": "2.23.9", - "codeql_standard_library": "codeql-cli/v2.23.9", - "codeql_cli_bundle": "codeql-bundle-v2.23.9" + "codeql_cli": "2.25.6", + "codeql_standard_library": "codeql-cli/v2.25.6", + "codeql_cli_bundle": "codeql-bundle-v2.25.6" } ], "supported_language": [ From cf900343858f78bb17fe4f5827672f3d8ec54c0d Mon Sep 17 00:00:00 2001 From: Mike Fairhurst Date: Sat, 19 Sep 2026 18:52:00 -0700 Subject: [PATCH 37/38] Accept test output changes --- ...MemberObjectWithExternalOrInternalLinkageIsReused.expected | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cpp/autosar/test/rules/A2-10-5/IdentifierNameOfANonMemberObjectWithExternalOrInternalLinkageIsReused.expected b/cpp/autosar/test/rules/A2-10-5/IdentifierNameOfANonMemberObjectWithExternalOrInternalLinkageIsReused.expected index d6f496a3c6..b3284a9970 100644 --- a/cpp/autosar/test/rules/A2-10-5/IdentifierNameOfANonMemberObjectWithExternalOrInternalLinkageIsReused.expected +++ b/cpp/autosar/test/rules/A2-10-5/IdentifierNameOfANonMemberObjectWithExternalOrInternalLinkageIsReused.expected @@ -1,6 +1,6 @@ | test1a.cpp:2:12:2:13 | g1 | Identifier name of non-member object $@ reuses the identifier name of non-member object $@. | test1a.cpp:2:12:2:13 | g1 | g1 | test1b.cpp:2:12:2:13 | g1 | g1 | | test1a.cpp:6:12:6:13 | g3 | Identifier name of non-member object $@ reuses the identifier name of non-member object $@. | test1a.cpp:6:12:6:13 | g3 | g3 | test1b.cpp:6:12:6:13 | g3 | g3 | -| test1a.cpp:17:50:17:50 | number_two | Identifier name of non-member object $@ reuses the identifier name of non-member object $@. | test1a.cpp:17:50:17:50 | number_two | number_two | test1b.cpp:11:50:11:50 | number_two | number_two | +| test1a.cpp:17:39:17:48 | number_two | Identifier name of non-member object $@ reuses the identifier name of non-member object $@. | test1a.cpp:17:39:17:48 | number_two | number_two | test1b.cpp:11:39:11:48 | number_two | number_two | | test1b.cpp:2:12:2:13 | g1 | Identifier name of non-member object $@ reuses the identifier name of non-member object $@. | test1b.cpp:2:12:2:13 | g1 | g1 | test1a.cpp:2:12:2:13 | g1 | g1 | | test1b.cpp:6:12:6:13 | g3 | Identifier name of non-member object $@ reuses the identifier name of non-member object $@. | test1b.cpp:6:12:6:13 | g3 | g3 | test1a.cpp:6:12:6:13 | g3 | g3 | -| test1b.cpp:11:50:11:50 | number_two | Identifier name of non-member object $@ reuses the identifier name of non-member object $@. | test1b.cpp:11:50:11:50 | number_two | number_two | test1a.cpp:17:50:17:50 | number_two | number_two | +| test1b.cpp:11:39:11:48 | number_two | Identifier name of non-member object $@ reuses the identifier name of non-member object $@. | test1b.cpp:11:39:11:48 | number_two | number_two | test1a.cpp:17:39:17:48 | number_two | number_two | From 209bbcec88e238cecb2717ebe88e3c2d69fa4de8 Mon Sep 17 00:00:00 2001 From: Mike Fairhurst Date: Sat, 19 Sep 2026 19:11:09 -0700 Subject: [PATCH 38/38] Fix additional failed test --- c/misra/test/rules/RULE-14-3/ControllingExprInvariant.expected | 1 - 1 file changed, 1 deletion(-) diff --git a/c/misra/test/rules/RULE-14-3/ControllingExprInvariant.expected b/c/misra/test/rules/RULE-14-3/ControllingExprInvariant.expected index 3beb834f84..c03c04d6cc 100644 --- a/c/misra/test/rules/RULE-14-3/ControllingExprInvariant.expected +++ b/c/misra/test/rules/RULE-14-3/ControllingExprInvariant.expected @@ -5,4 +5,3 @@ | test.c:27:10:27:14 | ... < ... | Controlling expression in loop statement has an invariant value. | | test.c:37:3:37:6 | 1 | Controlling expression in conditional statement has an invariant value. | | test.c:38:3:38:3 | 1 | Controlling expression in conditional statement has an invariant value. | -| test.c:45:10:45:26 | ... && ... | Controlling expression in loop statement has an invariant value. |