MCPcopy Create free account
hub / github.com/cppcheck-opensource/cppcheck / misra_15_3

Function misra_15_3

addons/test/misra/misra-test.c:1434–1465  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1432}
1433
1434static void misra_15_3(int a) {
1435 int x = 0;
1436 int y;
1437 if (x!=0) {
1438 goto L1; // 15.3 15.1
1439 if (y!=0) {
1440 L1:
1441 } else {}
1442 } else {}
1443
1444 switch (x) {
1445 case 0:
1446 if (x == y) {
1447 goto L2; // 15.3 15.1
1448 }
1449 goto L2; // 15.3 15.1
1450 L3:
1451 foo();
1452 if (a == 0x42) {
1453 // Compliant:
1454 goto L3; // 15.1 15.2
1455 }
1456 break;
1457 case 1:
1458 y = x;
1459 L2:
1460 ++x;
1461 break;
1462 default:
1463 break;
1464 }
1465}
1466
1467static void misra_15_4(void) {
1468 misra_15_4_label:

Callers

nothing calls this directly

Calls 1

fooFunction · 0.70

Tested by

no test coverage detected