From 421866e55b2b106321b62f8c39d8d0582cd7dab2 Mon Sep 17 00:00:00 2001 From: Jeroen Ketema Date: Tue, 6 Jan 2026 16:23:19 +0100 Subject: [PATCH 01/19] 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/19] 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/19] 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/19] 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/19] 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/19] 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/19] 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/19] 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/19] 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/19] 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/19] 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/19] 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/19] 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 803dbeb49eae475403226a8083f313d45f655f8e Mon Sep 17 00:00:00 2001 From: Jeroen Ketema Date: Wed, 29 Jul 2026 16:02:43 +0200 Subject: [PATCH 14/19] Disable tests that no longer work with the extractor --- .../NullptrNotTheOnlyFormOfTheNullPointerConstant.expected | 1 - .../nullptrnottheonlyformofthenullpointerconstant/test.cpp | 4 ++-- .../rules/RULE-7-0-6/NumericAssignmentTypeMismatch.expected | 1 - cpp/misra/test/rules/RULE-7-0-6/test.cpp | 4 ++-- 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/cpp/common/test/rules/nullptrnottheonlyformofthenullpointerconstant/NullptrNotTheOnlyFormOfTheNullPointerConstant.expected b/cpp/common/test/rules/nullptrnottheonlyformofthenullpointerconstant/NullptrNotTheOnlyFormOfTheNullPointerConstant.expected index f221a5421f..1d7a675b05 100644 --- a/cpp/common/test/rules/nullptrnottheonlyformofthenullpointerconstant/NullptrNotTheOnlyFormOfTheNullPointerConstant.expected +++ b/cpp/common/test/rules/nullptrnottheonlyformofthenullpointerconstant/NullptrNotTheOnlyFormOfTheNullPointerConstant.expected @@ -1,4 +1,3 @@ | test.cpp:10:13:10:13 | 0 | 0 is used as the null-pointer-constant but is not nullptr. | | test.cpp:11:6:11:6 | 0 | 0 is used as the null-pointer-constant but is not nullptr. | | test.cpp:17:6:17:9 | 0 | NULL is used as the null-pointer-constant but is not nullptr. | -| test.cpp:18:6:18:9 | 0 | '\\0' is used as the null-pointer-constant but is not nullptr. | diff --git a/cpp/common/test/rules/nullptrnottheonlyformofthenullpointerconstant/test.cpp b/cpp/common/test/rules/nullptrnottheonlyformofthenullpointerconstant/test.cpp index 4be1c7a239..5eb25c54bb 100644 --- a/cpp/common/test/rules/nullptrnottheonlyformofthenullpointerconstant/test.cpp +++ b/cpp/common/test/rules/nullptrnottheonlyformofthenullpointerconstant/test.cpp @@ -15,6 +15,6 @@ void test_nullptr() { int l3 = 0; // COMPLIANT - use of 0 literal with no conversion to pointer f3(f1, nullptr); // COMPLIANT - use of nullptr f1(NULL); // NON_COMPLIANT - use of NULL macro - f1('\0'); // NON_COMPLIANT - use of octal escape 0 + // f1('\0'); // NON_COMPLIANT - use of octal escape 0 - Not accepted by clang or by CodeQL when mimicking clang f3("0"); // COMPLIANT - "0" is not a literal zero -} \ No newline at end of file +} diff --git a/cpp/misra/test/rules/RULE-7-0-6/NumericAssignmentTypeMismatch.expected b/cpp/misra/test/rules/RULE-7-0-6/NumericAssignmentTypeMismatch.expected index 068608c126..51d3012840 100644 --- a/cpp/misra/test/rules/RULE-7-0-6/NumericAssignmentTypeMismatch.expected +++ b/cpp/misra/test/rules/RULE-7-0-6/NumericAssignmentTypeMismatch.expected @@ -53,7 +53,6 @@ | test.cpp:340:12:340:13 | s8 | Assignment between incompatible numeric types from 'int8_t' to 'int32_t'. | | test.cpp:342:32:342:33 | s8 | Assignment between incompatible numeric types from 'int8_t' to 'int32_t'. | | test.cpp:362:25:362:27 | u32 | Assignment between incompatible numeric types from 'uint32_t' to 'unsigned long'. | -| test.cpp:374:19:374:25 | ... + ... | Assignment between incompatible numeric types from 'int' to 'int16_t'. | | test.cpp:379:10:379:12 | u32 | Assignment between incompatible numeric types from 'uint32_t' to 'int32_t'. | | test.cpp:412:8:412:9 | l6 | Assignment between incompatible numeric types from 'uint32_t &' to 'uint8_t'. | | test.cpp:413:8:413:9 | l7 | Assignment between incompatible numeric types from 'int8_t &' to 'uint8_t'. | diff --git a/cpp/misra/test/rules/RULE-7-0-6/test.cpp b/cpp/misra/test/rules/RULE-7-0-6/test.cpp index 35aca81707..a52fae52e3 100644 --- a/cpp/misra/test/rules/RULE-7-0-6/test.cpp +++ b/cpp/misra/test/rules/RULE-7-0-6/test.cpp @@ -371,7 +371,7 @@ std::int32_t f12(std::int8_t l1) { std::int16_t l2 = l1; // COMPLIANT std::int16_t l3{l1}; // COMPLIANT std::int16_t l4(l1); // COMPLIANT - std::int16_t l5{l1 + l1}; // NON_COMPLIANT + // std::int16_t l5{l1 + l1}; // NON_COMPLIANT - Not accepted by clang or by CodeQL when mimicking clang return l1; // COMPLIANT } @@ -640,4 +640,4 @@ void test_explicit_casts() { // Function calls with explicit casts f1(static_cast(l4)); // COMPLIANT f2(static_cast(l4)); // COMPLIANT -} \ No newline at end of file +} From 49c05e339ccbf829bf710ba7a9c6468a9164486f Mon Sep 17 00:00:00 2001 From: Jeroen Ketema Date: Fri, 7 Aug 2026 10:27:34 +0200 Subject: [PATCH 15/19] Remove unused imports --- .../A13-2-2/BinaryOperatorAndBitwiseOperatorReturnAPrvalue.ql | 1 - .../rules/RULE-8-7-1/PointerArithmeticFormsAnInvalidPointer.ql | 1 - 2 files changed, 2 deletions(-) diff --git a/cpp/autosar/src/rules/A13-2-2/BinaryOperatorAndBitwiseOperatorReturnAPrvalue.ql b/cpp/autosar/src/rules/A13-2-2/BinaryOperatorAndBitwiseOperatorReturnAPrvalue.ql index c6c2e54378..8af33a43b2 100644 --- a/cpp/autosar/src/rules/A13-2-2/BinaryOperatorAndBitwiseOperatorReturnAPrvalue.ql +++ b/cpp/autosar/src/rules/A13-2-2/BinaryOperatorAndBitwiseOperatorReturnAPrvalue.ql @@ -17,7 +17,6 @@ import cpp import codingstandards.cpp.autosar import codingstandards.cpp.Operator -import semmle.code.cpp.Print from Operator o where 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 65b78f07d7..aa6ee9ffde 100644 --- a/cpp/misra/src/rules/RULE-8-7-1/PointerArithmeticFormsAnInvalidPointer.ql +++ b/cpp/misra/src/rules/RULE-8-7-1/PointerArithmeticFormsAnInvalidPointer.ql @@ -18,7 +18,6 @@ import cpp import codingstandards.cpp.misra import semmle.code.cpp.ir.IR import semmle.code.cpp.dataflow.new.DataFlow -import semmle.code.cpp.ir.dataflow.internal.DataFlowUtil import semmle.code.cpp.security.BufferAccess /** From cae9e29dba70f105e31ec28697e24ec089b5e1ab Mon Sep 17 00:00:00 2001 From: Jeroen Ketema Date: Thu, 3 Sep 2026 12:26:50 +0200 Subject: [PATCH 16/19] Update test after frontend upgrade --- .../rules/RULE-0-2-3/UnusedTypeWithLimitedVisibility.expected | 1 - cpp/misra/test/rules/RULE-0-2-3/templates.cpp | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/cpp/misra/test/rules/RULE-0-2-3/UnusedTypeWithLimitedVisibility.expected b/cpp/misra/test/rules/RULE-0-2-3/UnusedTypeWithLimitedVisibility.expected index 94b7534ec0..d37b5c3263 100644 --- a/cpp/misra/test/rules/RULE-0-2-3/UnusedTypeWithLimitedVisibility.expected +++ b/cpp/misra/test/rules/RULE-0-2-3/UnusedTypeWithLimitedVisibility.expected @@ -1,5 +1,4 @@ | templates.cpp:42:12:42:13 | A1 | Type 'A1' with limited visibility is not used. | -| templates.cpp:93:11:93:12 | A1 | Type 'A1' with limited visibility is not used. | | test.cpp:5:9:5:10 | T1 | Type 'T1' with limited visibility is not used. | | test.cpp:31:8:31:9 | A2 | Type 'A2' with limited visibility is not used. | | test.cpp:61:28:61:29 | C1<> | Type 'C1<>' with limited visibility is not used. | diff --git a/cpp/misra/test/rules/RULE-0-2-3/templates.cpp b/cpp/misra/test/rules/RULE-0-2-3/templates.cpp index ebfd09299f..17c802489c 100644 --- a/cpp/misra/test/rules/RULE-0-2-3/templates.cpp +++ b/cpp/misra/test/rules/RULE-0-2-3/templates.cpp @@ -90,7 +90,7 @@ namespace use_as_template_parameter_type { * parameter */ namespace use_as_template_parameter_default_value { - class A1 { // COMPLIANT[False positive] + class A1 { // COMPLIANT static const int a = 42; }; From fb4a2ececb33ba059002120600fd983c73f8895c Mon Sep 17 00:00:00 2001 From: Jeroen Ketema Date: Thu, 3 Sep 2026 12:33:28 +0200 Subject: [PATCH 17/19] Fix test formatting --- .../test.cpp | 5 +++-- cpp/misra/test/rules/RULE-7-0-6/test.cpp | 11 ++++++----- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/cpp/common/test/rules/nullptrnottheonlyformofthenullpointerconstant/test.cpp b/cpp/common/test/rules/nullptrnottheonlyformofthenullpointerconstant/test.cpp index 5eb25c54bb..1e9b1b50a7 100644 --- a/cpp/common/test/rules/nullptrnottheonlyformofthenullpointerconstant/test.cpp +++ b/cpp/common/test/rules/nullptrnottheonlyformofthenullpointerconstant/test.cpp @@ -15,6 +15,7 @@ void test_nullptr() { int l3 = 0; // COMPLIANT - use of 0 literal with no conversion to pointer f3(f1, nullptr); // COMPLIANT - use of nullptr f1(NULL); // NON_COMPLIANT - use of NULL macro - // f1('\0'); // NON_COMPLIANT - use of octal escape 0 - Not accepted by clang or by CodeQL when mimicking clang - f3("0"); // COMPLIANT - "0" is not a literal zero + // f1('\0'); // NON_COMPLIANT - use of octal escape 0 - Not accepted by + // clang or by CodeQL when mimicking clang + f3("0"); // COMPLIANT - "0" is not a literal zero } diff --git a/cpp/misra/test/rules/RULE-7-0-6/test.cpp b/cpp/misra/test/rules/RULE-7-0-6/test.cpp index a52fae52e3..f076d18ede 100644 --- a/cpp/misra/test/rules/RULE-7-0-6/test.cpp +++ b/cpp/misra/test/rules/RULE-7-0-6/test.cpp @@ -368,11 +368,12 @@ void test_template_functions() { // Test initialization forms std::int32_t f12(std::int8_t l1) { - std::int16_t l2 = l1; // COMPLIANT - std::int16_t l3{l1}; // COMPLIANT - std::int16_t l4(l1); // COMPLIANT - // std::int16_t l5{l1 + l1}; // NON_COMPLIANT - Not accepted by clang or by CodeQL when mimicking clang - return l1; // COMPLIANT + std::int16_t l2 = l1; // COMPLIANT + std::int16_t l3{l1}; // COMPLIANT + std::int16_t l4(l1); // COMPLIANT + // std::int16_t l5{l1 + l1}; // NON_COMPLIANT - Not accepted by clang or by + // CodeQL when mimicking clang + return l1; // COMPLIANT } std::int32_t test_return() { From f254174a7236d9514bd74019b9a68fce04b2115e Mon Sep 17 00:00:00 2001 From: Jeroen Ketema Date: Fri, 4 Sep 2026 16:18:04 +0200 Subject: [PATCH 18/19] Fix alert locations after reformatting --- .../NumericAssignmentTypeMismatch.expected | 68 +++++++++---------- 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/cpp/misra/test/rules/RULE-7-0-6/NumericAssignmentTypeMismatch.expected b/cpp/misra/test/rules/RULE-7-0-6/NumericAssignmentTypeMismatch.expected index 51d3012840..cf7fb5e402 100644 --- a/cpp/misra/test/rules/RULE-7-0-6/NumericAssignmentTypeMismatch.expected +++ b/cpp/misra/test/rules/RULE-7-0-6/NumericAssignmentTypeMismatch.expected @@ -53,40 +53,40 @@ | test.cpp:340:12:340:13 | s8 | Assignment between incompatible numeric types from 'int8_t' to 'int32_t'. | | test.cpp:342:32:342:33 | s8 | Assignment between incompatible numeric types from 'int8_t' to 'int32_t'. | | test.cpp:362:25:362:27 | u32 | Assignment between incompatible numeric types from 'uint32_t' to 'unsigned long'. | -| test.cpp:379:10:379:12 | u32 | Assignment between incompatible numeric types from 'uint32_t' to 'int32_t'. | -| test.cpp:412:8:412:9 | l6 | Assignment between incompatible numeric types from 'uint32_t &' to 'uint8_t'. | -| test.cpp:413:8:413:9 | l7 | Assignment between incompatible numeric types from 'int8_t &' to 'uint8_t'. | -| test.cpp:414:9:414:10 | l8 | Assignment between incompatible numeric types from 'float &' to 'int32_t'. | -| test.cpp:425:6:425:7 | l3 | Assignment between incompatible numeric types from 'uint8_t &' to 'int64_t'. | -| test.cpp:426:6:426:7 | l4 | Assignment between incompatible numeric types from 'uint16_t &' to 'int32_t'. | -| test.cpp:437:8:437:9 | l3 | Assignment between incompatible numeric types from 'uint8_t &' to 'int8_t'. | -| test.cpp:438:8:438:9 | l4 | Assignment between incompatible numeric types from 'int8_t &' to 'uint8_t'. | -| test.cpp:451:9:451:10 | l4 | Assignment between incompatible numeric types from 'float &' to 'int32_t'. | -| test.cpp:452:7:452:8 | l5 | Assignment between incompatible numeric types from 'double &' to 'float'. | -| test.cpp:453:7:453:8 | l6 | Assignment between incompatible numeric types from 'int32_t &' to 'float'. | -| test.cpp:464:8:464:14 | ... + ... | Assignment between incompatible numeric types from 'int' to 'uint8_t'. | -| test.cpp:482:7:482:8 | l3 | Assignment between incompatible numeric types from 'uint16_t &' to 'uint32_t'. | -| test.cpp:485:7:485:8 | l5 | Assignment between incompatible numeric types from 'uint64_t &' to 'uint32_t'. | -| test.cpp:534:12:534:13 | l1 | Assignment between incompatible numeric types from 'uint32_t' to 'uint8_t'. | -| test.cpp:535:12:535:13 | l1 | Assignment between incompatible numeric types from 'uint32_t' to 'uint16_t'. | -| test.cpp:537:12:537:13 | l2 | Assignment between incompatible numeric types from 'int32_t' to 'int8_t'. | -| test.cpp:538:12:538:13 | l2 | Assignment between incompatible numeric types from 'int32_t' to 'int16_t'. | -| test.cpp:558:12:558:14 | 300 | Assignment between incompatible numeric types from 'int' to 'uint8_t'. | -| test.cpp:559:12:559:16 | 70000 | Assignment between incompatible numeric types from 'int' to 'uint16_t'. | -| test.cpp:560:12:560:27 | 4294967296 | Assignment between incompatible numeric types from 'unsigned long long' to 'uint32_t'. | -| test.cpp:561:12:561:14 | 200 | Assignment between incompatible numeric types from 'int' to 'int8_t'. | -| test.cpp:562:12:562:16 | 40000 | Assignment between incompatible numeric types from 'int' to 'int16_t'. | -| test.cpp:563:12:563:26 | 4294967296 | Assignment between incompatible numeric types from 'long long' to 'int32_t'. | -| test.cpp:564:12:564:14 | 1.0 | Assignment between incompatible numeric types from 'double' to 'float'. | -| test.cpp:565:12:565:15 | 1.0 | Assignment between incompatible numeric types from 'float' to 'double'. | -| test.cpp:570:12:570:18 | ... + ... | Assignment between incompatible numeric types from 'int' to 'uint8_t'. | -| test.cpp:571:12:571:18 | ... + ... | Assignment between incompatible numeric types from 'int' to 'uint16_t'. | -| test.cpp:572:12:572:18 | ... + ... | Assignment between incompatible numeric types from 'int' to 'uint32_t'. | -| test.cpp:574:12:574:13 | l1 | Assignment between incompatible numeric types from 'uint8_t' to 'int16_t'. | -| test.cpp:575:12:575:13 | l1 | Assignment between incompatible numeric types from 'uint8_t' to 'int32_t'. | -| test.cpp:576:12:576:13 | l1 | Assignment between incompatible numeric types from 'uint8_t' to 'float'. | -| test.cpp:577:12:577:13 | l1 | Assignment between incompatible numeric types from 'uint8_t' to 'double'. | -| test.cpp:607:9:607:37 | static_cast... | Assignment between incompatible numeric types from 'int16_t' to 'int32_t'. | +| test.cpp:380:10:380:12 | u32 | Assignment between incompatible numeric types from 'uint32_t' to 'int32_t'. | +| test.cpp:413:8:413:9 | l6 | Assignment between incompatible numeric types from 'uint32_t &' to 'uint8_t'. | +| test.cpp:414:8:414:9 | l7 | Assignment between incompatible numeric types from 'int8_t &' to 'uint8_t'. | +| test.cpp:415:9:415:10 | l8 | Assignment between incompatible numeric types from 'float &' to 'int32_t'. | +| test.cpp:426:6:426:7 | l3 | Assignment between incompatible numeric types from 'uint8_t &' to 'int64_t'. | +| test.cpp:427:6:427:7 | l4 | Assignment between incompatible numeric types from 'uint16_t &' to 'int32_t'. | +| test.cpp:438:8:438:9 | l3 | Assignment between incompatible numeric types from 'uint8_t &' to 'int8_t'. | +| test.cpp:439:8:439:9 | l4 | Assignment between incompatible numeric types from 'int8_t &' to 'uint8_t'. | +| test.cpp:452:9:452:10 | l4 | Assignment between incompatible numeric types from 'float &' to 'int32_t'. | +| test.cpp:453:7:453:8 | l5 | Assignment between incompatible numeric types from 'double &' to 'float'. | +| test.cpp:454:7:454:8 | l6 | Assignment between incompatible numeric types from 'int32_t &' to 'float'. | +| test.cpp:465:8:465:14 | ... + ... | Assignment between incompatible numeric types from 'int' to 'uint8_t'. | +| test.cpp:483:7:483:8 | l3 | Assignment between incompatible numeric types from 'uint16_t &' to 'uint32_t'. | +| test.cpp:486:7:486:8 | l5 | Assignment between incompatible numeric types from 'uint64_t &' to 'uint32_t'. | +| test.cpp:535:12:535:13 | l1 | Assignment between incompatible numeric types from 'uint32_t' to 'uint8_t'. | +| test.cpp:536:12:536:13 | l1 | Assignment between incompatible numeric types from 'uint32_t' to 'uint16_t'. | +| test.cpp:538:12:538:13 | l2 | Assignment between incompatible numeric types from 'int32_t' to 'int8_t'. | +| test.cpp:539:12:539:13 | l2 | Assignment between incompatible numeric types from 'int32_t' to 'int16_t'. | +| test.cpp:559:12:559:14 | 300 | Assignment between incompatible numeric types from 'int' to 'uint8_t'. | +| test.cpp:560:12:560:16 | 70000 | Assignment between incompatible numeric types from 'int' to 'uint16_t'. | +| test.cpp:561:12:561:27 | 4294967296 | Assignment between incompatible numeric types from 'unsigned long long' to 'uint32_t'. | +| test.cpp:562:12:562:14 | 200 | Assignment between incompatible numeric types from 'int' to 'int8_t'. | +| test.cpp:563:12:563:16 | 40000 | Assignment between incompatible numeric types from 'int' to 'int16_t'. | +| test.cpp:564:12:564:26 | 4294967296 | Assignment between incompatible numeric types from 'long long' to 'int32_t'. | +| test.cpp:565:12:565:14 | 1.0 | Assignment between incompatible numeric types from 'double' to 'float'. | +| test.cpp:566:12:566:15 | 1.0 | Assignment between incompatible numeric types from 'float' to 'double'. | +| test.cpp:571:12:571:18 | ... + ... | Assignment between incompatible numeric types from 'int' to 'uint8_t'. | +| test.cpp:572:12:572:18 | ... + ... | Assignment between incompatible numeric types from 'int' to 'uint16_t'. | +| test.cpp:573:12:573:18 | ... + ... | Assignment between incompatible numeric types from 'int' to 'uint32_t'. | +| test.cpp:575:12:575:13 | l1 | Assignment between incompatible numeric types from 'uint8_t' to 'int16_t'. | +| test.cpp:576:12:576:13 | l1 | Assignment between incompatible numeric types from 'uint8_t' to 'int32_t'. | +| test.cpp:577:12:577:13 | l1 | Assignment between incompatible numeric types from 'uint8_t' to 'float'. | +| test.cpp:578:12:578:13 | l1 | Assignment between incompatible numeric types from 'uint8_t' to 'double'. | +| test.cpp:608:9:608:37 | static_cast... | Assignment between incompatible numeric types from 'int16_t' to 'int32_t'. | | test_aggregate.cpp:29:22:29:24 | u16 | Assignment between incompatible numeric types from 'uint16_t' to 'uint8_t'. | | test_aggregate.cpp:31:26:31:28 | u32 | Assignment between incompatible numeric types from 'uint32_t' to 'uint16_t'. | | test_aggregate.cpp:33:31:33:33 | u32 | Assignment between incompatible numeric types from 'uint32_t' to 'int32_t'. | From 51a945fa14ad9e859556509e7e1f7caffde7f48b Mon Sep 17 00:00:00 2001 From: Jeroen Ketema Date: Tue, 27 Oct 2026 12:32:08 +0100 Subject: [PATCH 19/19] Fix tests after merge from main --- .../test/rules/RULE-14-3/ControllingExprInvariant.expected | 1 - c/misra/test/rules/RULE-14-3/test.c | 2 +- ...MemberObjectWithExternalOrInternalLinkageIsReused.expected | 4 ++-- 3 files changed, 3 insertions(+), 4 deletions(-) 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. | diff --git a/c/misra/test/rules/RULE-14-3/test.c b/c/misra/test/rules/RULE-14-3/test.c index ed8854afd2..94b10d36b0 100644 --- a/c/misra/test/rules/RULE-14-3/test.c +++ b/c/misra/test/rules/RULE-14-3/test.c @@ -42,6 +42,6 @@ void f5(bool b1) { void f6(int p1) { while (p1 < 10 && p1 > 12) { // NON_COMPLIANT[FALSE_NEGATIVE] } - while (1 == 0 && p1 > 12) { // NON_COMPLIANT + while (1 == 0 && p1 > 12) { // NON_COMPLIANT[FALSE_NEGATIVE] } } \ No newline at end of file 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 |