adlint 1.12.0 → 1.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/ChangeLog +133 -34
- data/MANIFEST +10 -0
- data/NEWS +22 -4
- data/etc/mesg.d/en_US/messages.yml +1 -1
- data/etc/mesg.d/ja_JP/messages.yml +1 -1
- data/features/message_detection/W0093.feature +3 -3
- data/features/message_detection/W0104.feature +111 -0
- data/features/message_detection/W0606.feature +1 -1
- data/features/message_detection/W0645.feature +142 -0
- data/features/message_detection/W0697.feature +183 -0
- data/features/message_detection/W0699.feature +1 -0
- data/features/message_detection/W0700.feature +56 -0
- data/features/message_detection/W1031.feature +18 -18
- data/features/message_detection/W1066.feature +88 -0
- data/features/message_detection/W1067.feature +88 -0
- data/features/message_detection/W1068.feature +88 -0
- data/features/message_detection/W1069.feature +120 -0
- data/features/message_detection/W1070.feature +145 -0
- data/features/message_detection/W1072.feature +32 -0
- data/lib/adlint/c/interp.rb +17 -10
- data/lib/adlint/c/mediator.rb +1 -0
- data/lib/adlint/c/message_shima.rb +222 -0
- data/lib/adlint/c/phase.rb +9 -0
- data/lib/adlint/c/type.rb +13 -12
- data/lib/adlint/version.rb +2 -2
- data/share/doc/developers_guide_ja.html +3 -3
- data/share/doc/developers_guide_ja.texi +1 -1
- data/share/doc/users_guide_en.html +59 -50
- data/share/doc/users_guide_en.texi +48 -40
- data/share/doc/users_guide_ja.html +60 -52
- data/share/doc/users_guide_ja.texi +49 -41
- metadata +12 -2
@@ -1,8 +1,8 @@
|
|
1
1
|
<html lang="ja">
|
2
2
|
<head>
|
3
|
-
<title>AdLint 1.
|
3
|
+
<title>AdLint 1.14.0 開発者ガイド</title>
|
4
4
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
5
|
-
<meta name="description" content="AdLint 1.
|
5
|
+
<meta name="description" content="AdLint 1.14.0 開発者ガイド">
|
6
6
|
<meta name="generator" content="makeinfo 4.13">
|
7
7
|
<link title="Top" rel="top" href="#Top">
|
8
8
|
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
|
@@ -44,7 +44,7 @@ td { border: 1px solid black; }
|
|
44
44
|
--></style>
|
45
45
|
</head>
|
46
46
|
<body>
|
47
|
-
<h1 class="settitle">AdLint 1.
|
47
|
+
<h1 class="settitle">AdLint 1.14.0 開発者ガイド</h1>
|
48
48
|
<div class="contents">
|
49
49
|
<h2>Table of Contents</h2>
|
50
50
|
<ul>
|
@@ -1,8 +1,8 @@
|
|
1
1
|
<html lang="en">
|
2
2
|
<head>
|
3
|
-
<title>AdLint 1.
|
3
|
+
<title>AdLint 1.14.0 User's Guide</title>
|
4
4
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
5
|
-
<meta name="description" content="AdLint 1.
|
5
|
+
<meta name="description" content="AdLint 1.14.0 User's Guide">
|
6
6
|
<meta name="generator" content="makeinfo 4.13">
|
7
7
|
<link title="Top" rel="top" href="#Top">
|
8
8
|
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
|
@@ -44,7 +44,7 @@ td { border: 1px solid black; }
|
|
44
44
|
--></style>
|
45
45
|
</head>
|
46
46
|
<body>
|
47
|
-
<h1 class="settitle">AdLint 1.
|
47
|
+
<h1 class="settitle">AdLint 1.14.0 User's Guide</h1>
|
48
48
|
<div class="node">
|
49
49
|
<a name="Top"></a>
|
50
50
|
<p><hr>
|
@@ -30527,17 +30527,18 @@ Up: <a rel="up" accesskey="u" href="#Messages">Messages</a>
|
|
30527
30527
|
|
30528
30528
|
<h4 class="subsection">6.527.1 Message body</h4>
|
30529
30529
|
|
30530
|
-
<p
|
30530
|
+
<p>`void' cannot be used as the parameter type.
|
30531
30531
|
|
30532
30532
|
<h4 class="subsection">6.527.2 Content</h4>
|
30533
30533
|
|
30534
|
-
<p
|
30535
|
-
|
30536
|
-
<p>Under construction.
|
30534
|
+
<p>Under construction.
|
30537
30535
|
|
30538
30536
|
<h4 class="subsection">6.527.3 Sample code</h4>
|
30539
30537
|
|
30540
|
-
<pre class="verbatim"
|
30538
|
+
<pre class="verbatim">extern void func(a) /* W0645 */
|
30539
|
+
void a;
|
30540
|
+
{
|
30541
|
+
}
|
30541
30542
|
</pre>
|
30542
30543
|
|
30543
30544
|
<h4 class="subsection">6.527.4 Related message</h4>
|
@@ -30551,7 +30552,7 @@ Up: <a rel="up" accesskey="u" href="#Messages">Messages</a>
|
|
30551
30552
|
|
30552
30553
|
<h4 class="subsection">6.527.5 Since</h4>
|
30553
30554
|
|
30554
|
-
<p>
|
30555
|
+
<p>1.14.0
|
30555
30556
|
|
30556
30557
|
<div class="node">
|
30557
30558
|
<a name="W0646"></a>
|
@@ -33405,9 +33406,7 @@ Up: <a rel="up" accesskey="u" href="#Messages">Messages</a>
|
|
33405
33406
|
|
33406
33407
|
<h4 class="subsection">6.575.2 Content</h4>
|
33407
33408
|
|
33408
|
-
<p
|
33409
|
-
|
33410
|
-
<p>Under construction.
|
33409
|
+
<p>Under construction.
|
33411
33410
|
|
33412
33411
|
<h4 class="subsection">6.575.3 Sample code</h4>
|
33413
33412
|
|
@@ -33416,7 +33415,7 @@ Up: <a rel="up" accesskey="u" href="#Messages">Messages</a>
|
|
33416
33415
|
if (value == 0) {
|
33417
33416
|
return 0;
|
33418
33417
|
}
|
33419
|
-
|
33418
|
+
/* No return statement at the end of this function. */
|
33420
33419
|
}
|
33421
33420
|
</pre>
|
33422
33421
|
|
@@ -33430,7 +33429,7 @@ Up: <a rel="up" accesskey="u" href="#Messages">Messages</a>
|
|
33430
33429
|
|
33431
33430
|
<h4 class="subsection">6.575.5 Since</h4>
|
33432
33431
|
|
33433
|
-
<p>
|
33432
|
+
<p>1.14.0
|
33434
33433
|
|
33435
33434
|
<div class="node">
|
33436
33435
|
<a name="W0698"></a>
|
@@ -33533,13 +33532,13 @@ Up: <a rel="up" accesskey="u" href="#Messages">Messages</a>
|
|
33533
33532
|
|
33534
33533
|
<h4 class="subsection">6.578.2 Content</h4>
|
33535
33534
|
|
33536
|
-
<p
|
33537
|
-
|
33538
|
-
<p>Under construction.
|
33535
|
+
<p>Under construction.
|
33539
33536
|
|
33540
33537
|
<h4 class="subsection">6.578.3 Sample code</h4>
|
33541
33538
|
|
33542
|
-
<pre class="verbatim"
|
33539
|
+
<pre class="verbatim">extern func(void) /* W0700 */
|
33540
|
+
{
|
33541
|
+
}
|
33543
33542
|
</pre>
|
33544
33543
|
|
33545
33544
|
<h4 class="subsection">6.578.4 Related message</h4>
|
@@ -33552,7 +33551,7 @@ Up: <a rel="up" accesskey="u" href="#Messages">Messages</a>
|
|
33552
33551
|
|
33553
33552
|
<h4 class="subsection">6.578.5 Since</h4>
|
33554
33553
|
|
33555
|
-
<p>
|
33554
|
+
<p>1.14.0
|
33556
33555
|
|
33557
33556
|
<div class="node">
|
33558
33557
|
<a name="W0703"></a>
|
@@ -40390,9 +40389,7 @@ Up: <a rel="up" accesskey="u" href="#Messages">Messages</a>
|
|
40390
40389
|
|
40391
40390
|
<h4 class="subsection">6.731.2 Content</h4>
|
40392
40391
|
|
40393
|
-
<p
|
40394
|
-
|
40395
|
-
<p>Under construction.
|
40392
|
+
<p>Under construction.
|
40396
40393
|
|
40397
40394
|
<h4 class="subsection">6.731.3 Sample code</h4>
|
40398
40395
|
|
@@ -40411,7 +40408,7 @@ Up: <a rel="up" accesskey="u" href="#Messages">Messages</a>
|
|
40411
40408
|
|
40412
40409
|
<h4 class="subsection">6.731.5 Since</h4>
|
40413
40410
|
|
40414
|
-
<p>
|
40411
|
+
<p>1.14.0
|
40415
40412
|
|
40416
40413
|
<div class="node">
|
40417
40414
|
<a name="W1067"></a>
|
@@ -40432,9 +40429,7 @@ Up: <a rel="up" accesskey="u" href="#Messages">Messages</a>
|
|
40432
40429
|
|
40433
40430
|
<h4 class="subsection">6.732.2 Content</h4>
|
40434
40431
|
|
40435
|
-
<p
|
40436
|
-
|
40437
|
-
<p>Under construction.
|
40432
|
+
<p>Under construction.
|
40438
40433
|
|
40439
40434
|
<h4 class="subsection">6.732.3 Sample code</h4>
|
40440
40435
|
|
@@ -40453,7 +40448,7 @@ Up: <a rel="up" accesskey="u" href="#Messages">Messages</a>
|
|
40453
40448
|
|
40454
40449
|
<h4 class="subsection">6.732.5 Since</h4>
|
40455
40450
|
|
40456
|
-
<p>
|
40451
|
+
<p>1.14.0
|
40457
40452
|
|
40458
40453
|
<div class="node">
|
40459
40454
|
<a name="W1068"></a>
|
@@ -40474,9 +40469,7 @@ Up: <a rel="up" accesskey="u" href="#Messages">Messages</a>
|
|
40474
40469
|
|
40475
40470
|
<h4 class="subsection">6.733.2 Content</h4>
|
40476
40471
|
|
40477
|
-
<p
|
40478
|
-
|
40479
|
-
<p>Under construction.
|
40472
|
+
<p>Under construction.
|
40480
40473
|
|
40481
40474
|
<h4 class="subsection">6.733.3 Sample code</h4>
|
40482
40475
|
|
@@ -40495,7 +40488,7 @@ Up: <a rel="up" accesskey="u" href="#Messages">Messages</a>
|
|
40495
40488
|
|
40496
40489
|
<h4 class="subsection">6.733.5 Since</h4>
|
40497
40490
|
|
40498
|
-
<p>
|
40491
|
+
<p>1.14.0
|
40499
40492
|
|
40500
40493
|
<div class="node">
|
40501
40494
|
<a name="W1069"></a>
|
@@ -40516,13 +40509,20 @@ Up: <a rel="up" accesskey="u" href="#Messages">Messages</a>
|
|
40516
40509
|
|
40517
40510
|
<h4 class="subsection">6.734.2 Content</h4>
|
40518
40511
|
|
40519
|
-
<p
|
40520
|
-
|
40521
|
-
<p>Under construction.
|
40512
|
+
<p>Under construction.
|
40522
40513
|
|
40523
40514
|
<h4 class="subsection">6.734.3 Sample code</h4>
|
40524
40515
|
|
40525
|
-
<pre class="verbatim"
|
40516
|
+
<pre class="verbatim">static int func(int i)
|
40517
|
+
{
|
40518
|
+
if (i == 2) { /* W1069 */
|
40519
|
+
return 0;
|
40520
|
+
}
|
40521
|
+
else if (i == 4) {
|
40522
|
+
return 1;
|
40523
|
+
}
|
40524
|
+
return 2;
|
40525
|
+
}
|
40526
40526
|
</pre>
|
40527
40527
|
|
40528
40528
|
<h4 class="subsection">6.734.4 Related message</h4>
|
@@ -40531,7 +40531,7 @@ Up: <a rel="up" accesskey="u" href="#Messages">Messages</a>
|
|
40531
40531
|
|
40532
40532
|
<h4 class="subsection">6.734.5 Since</h4>
|
40533
40533
|
|
40534
|
-
<p>
|
40534
|
+
<p>1.14.0
|
40535
40535
|
|
40536
40536
|
<div class="node">
|
40537
40537
|
<a name="W1070"></a>
|
@@ -40552,9 +40552,7 @@ Up: <a rel="up" accesskey="u" href="#Messages">Messages</a>
|
|
40552
40552
|
|
40553
40553
|
<h4 class="subsection">6.735.2 Content</h4>
|
40554
40554
|
|
40555
|
-
<p
|
40556
|
-
|
40557
|
-
<p>Under construction.
|
40555
|
+
<p>Under construction.
|
40558
40556
|
|
40559
40557
|
<h4 class="subsection">6.735.3 Sample code</h4>
|
40560
40558
|
|
@@ -40573,7 +40571,7 @@ default:
|
|
40573
40571
|
|
40574
40572
|
<h4 class="subsection">6.735.5 Since</h4>
|
40575
40573
|
|
40576
|
-
<p>
|
40574
|
+
<p>1.14.0
|
40577
40575
|
|
40578
40576
|
<div class="node">
|
40579
40577
|
<a name="W1071"></a>
|
@@ -40638,13 +40636,24 @@ Up: <a rel="up" accesskey="u" href="#Messages">Messages</a>
|
|
40638
40636
|
|
40639
40637
|
<h4 class="subsection">6.737.2 Content</h4>
|
40640
40638
|
|
40641
|
-
<p
|
40642
|
-
|
40643
|
-
<p>Under construction.
|
40639
|
+
<p>Under construction.
|
40644
40640
|
|
40645
40641
|
<h4 class="subsection">6.737.3 Sample code</h4>
|
40646
40642
|
|
40647
|
-
<pre class="verbatim"
|
40643
|
+
<pre class="verbatim">static int func(int i)
|
40644
|
+
{
|
40645
|
+
if (i == 1) {
|
40646
|
+
goto Label1; /* W1072 */
|
40647
|
+
}
|
40648
|
+
|
40649
|
+
goto Label2; /* W1072 */
|
40650
|
+
|
40651
|
+
Label1:
|
40652
|
+
i = 10;
|
40653
|
+
Label2:
|
40654
|
+
i = 20;
|
40655
|
+
return i;
|
40656
|
+
}
|
40648
40657
|
</pre>
|
40649
40658
|
|
40650
40659
|
<h4 class="subsection">6.737.4 Related message</h4>
|
@@ -40653,7 +40662,7 @@ Up: <a rel="up" accesskey="u" href="#Messages">Messages</a>
|
|
40653
40662
|
|
40654
40663
|
<h4 class="subsection">6.737.5 Since</h4>
|
40655
40664
|
|
40656
|
-
<p>
|
40665
|
+
<p>1.14.0
|
40657
40666
|
|
40658
40667
|
<div class="node">
|
40659
40668
|
<a name="W1073"></a>
|
@@ -41704,11 +41713,11 @@ Up: <a rel="up" accesskey="u" href="#Metrics">Metrics</a>
|
|
41704
41713
|
|
41705
41714
|
<h4 class="subsection">7.12.1 Metric name</h4>
|
41706
41715
|
|
41707
|
-
<p>Number of
|
41716
|
+
<p>Number of <code>`if'</code> statement without <code>`else'</code> clause
|
41708
41717
|
|
41709
41718
|
<h4 class="subsection">7.12.2 Content</h4>
|
41710
41719
|
|
41711
|
-
<p>The number of
|
41720
|
+
<p>The number of <code>`if'</code> statements which have no explicit <code>else</code> clause.
|
41712
41721
|
|
41713
41722
|
<h4 class="subsection">7.12.3 Sample code</h4>
|
41714
41723
|
|
@@ -41726,7 +41735,7 @@ Up: <a rel="up" accesskey="u" href="#Metrics">Metrics</a>
|
|
41726
41735
|
if (j % 2) {
|
41727
41736
|
return -1;
|
41728
41737
|
}
|
41729
|
-
/*
|
41738
|
+
/* A standalone if-statement does nothing to the FN_UELS metric */
|
41730
41739
|
|
41731
41740
|
if (i == 2) {
|
41732
41741
|
return 0;
|
@@ -41738,11 +41747,11 @@ Up: <a rel="up" accesskey="u" href="#Metrics">Metrics</a>
|
|
41738
41747
|
|
41739
41748
|
return 5;
|
41740
41749
|
|
41741
|
-
/* foo's FN_UELS ==
|
41750
|
+
/* foo's FN_UELS == 1 */
|
41742
41751
|
}
|
41743
41752
|
</pre>
|
41744
41753
|
|
41745
|
-
<pre class="example"> MET,FN_UELS,foo,int foo(int),test.c,1,5,
|
41754
|
+
<pre class="example"> MET,FN_UELS,foo,int foo(int),test.c,1,5,1
|
41746
41755
|
</pre>
|
41747
41756
|
<h4 class="subsection">7.12.4 Since</h4>
|
41748
41757
|
|
@@ -2,7 +2,7 @@
|
|
2
2
|
@setfilename users_guide_en.info
|
3
3
|
@documentlanguage en
|
4
4
|
@documentencoding utf-8
|
5
|
-
@settitle AdLint 1.
|
5
|
+
@settitle AdLint 1.14.0 User's Guide
|
6
6
|
|
7
7
|
@copying
|
8
8
|
Copyright (C) 2010-2012, OGIS-RI Co.,Ltd.
|
@@ -26345,18 +26345,19 @@ if(func() == 0) { /* W0644 */
|
|
26345
26345
|
|
26346
26346
|
@subsection Message body
|
26347
26347
|
|
26348
|
-
|
26348
|
+
`void' cannot be used as the parameter type.
|
26349
26349
|
|
26350
26350
|
@subsection Content
|
26351
26351
|
|
26352
|
-
@b{This message will be supported in AdLint 2.0.0}
|
26353
|
-
|
26354
26352
|
Under construction.
|
26355
26353
|
|
26356
26354
|
@subsection Sample code
|
26357
26355
|
|
26358
26356
|
@verbatim
|
26359
|
-
|
26357
|
+
extern void func(a) /* W0645 */
|
26358
|
+
void a;
|
26359
|
+
{
|
26360
|
+
}
|
26360
26361
|
@end verbatim
|
26361
26362
|
|
26362
26363
|
@subsection Related message
|
@@ -26370,7 +26371,7 @@ Under construction.
|
|
26370
26371
|
|
26371
26372
|
@subsection Since
|
26372
26373
|
|
26373
|
-
|
26374
|
+
1.14.0
|
26374
26375
|
|
26375
26376
|
@node W0646
|
26376
26377
|
@section W0646
|
@@ -28841,8 +28842,6 @@ There is a path with exits with an implicit `return;' statement in a function `%
|
|
28841
28842
|
|
28842
28843
|
@subsection Content
|
28843
28844
|
|
28844
|
-
@b{This message will be supported in AdLint 2.0.0}
|
28845
|
-
|
28846
28845
|
Under construction.
|
28847
28846
|
|
28848
28847
|
@subsection Sample code
|
@@ -28853,7 +28852,7 @@ int func(int value) /* W0697 */
|
|
28853
28852
|
if (value == 0) {
|
28854
28853
|
return 0;
|
28855
28854
|
}
|
28856
|
-
|
28855
|
+
/* No return statement at the end of this function. */
|
28857
28856
|
}
|
28858
28857
|
@end verbatim
|
28859
28858
|
|
@@ -28867,7 +28866,7 @@ int func(int value) /* W0697 */
|
|
28867
28866
|
|
28868
28867
|
@subsection Since
|
28869
28868
|
|
28870
|
-
|
28869
|
+
1.14.0
|
28871
28870
|
|
28872
28871
|
@node W0698
|
28873
28872
|
@section W0698
|
@@ -28945,14 +28944,14 @@ The return value of function `%s()' is unspecified. The return value is implicit
|
|
28945
28944
|
|
28946
28945
|
@subsection Content
|
28947
28946
|
|
28948
|
-
@b{This message will be supported in AdLint 2.0.0}
|
28949
|
-
|
28950
28947
|
Under construction.
|
28951
28948
|
|
28952
28949
|
@subsection Sample code
|
28953
28950
|
|
28954
28951
|
@verbatim
|
28955
|
-
|
28952
|
+
extern func(void) /* W0700 */
|
28953
|
+
{
|
28954
|
+
}
|
28956
28955
|
@end verbatim
|
28957
28956
|
|
28958
28957
|
@subsection Related message
|
@@ -28966,7 +28965,7 @@ Under construction.
|
|
28966
28965
|
|
28967
28966
|
@subsection Since
|
28968
28967
|
|
28969
|
-
|
28968
|
+
1.14.0
|
28970
28969
|
|
28971
28970
|
@node W0703
|
28972
28971
|
@section W0703
|
@@ -34589,8 +34588,6 @@ A value of the `float' typed compound expression is explicitly converted into a
|
|
34589
34588
|
|
34590
34589
|
@subsection Content
|
34591
34590
|
|
34592
|
-
@b{This message will be supported in AdLint 2.0.0}
|
34593
|
-
|
34594
34591
|
Under construction.
|
34595
34592
|
|
34596
34593
|
@subsection Sample code
|
@@ -34611,7 +34608,7 @@ void func(float a)
|
|
34611
34608
|
|
34612
34609
|
@subsection Since
|
34613
34610
|
|
34614
|
-
|
34611
|
+
1.14.0
|
34615
34612
|
|
34616
34613
|
@node W1067
|
34617
34614
|
@section W1067
|
@@ -34623,8 +34620,6 @@ A value of the `float' typed compound expression is explicitly converted into a
|
|
34623
34620
|
|
34624
34621
|
@subsection Content
|
34625
34622
|
|
34626
|
-
@b{This message will be supported in AdLint 2.0.0}
|
34627
|
-
|
34628
34623
|
Under construction.
|
34629
34624
|
|
34630
34625
|
@subsection Sample code
|
@@ -34645,7 +34640,7 @@ void func(float a)
|
|
34645
34640
|
|
34646
34641
|
@subsection Since
|
34647
34642
|
|
34648
|
-
|
34643
|
+
1.14.0
|
34649
34644
|
|
34650
34645
|
@node W1068
|
34651
34646
|
@section W1068
|
@@ -34657,8 +34652,6 @@ A value of the `double' typed compound expression is explicitly converted into a
|
|
34657
34652
|
|
34658
34653
|
@subsection Content
|
34659
34654
|
|
34660
|
-
@b{This message will be supported in AdLint 2.0.0}
|
34661
|
-
|
34662
34655
|
Under construction.
|
34663
34656
|
|
34664
34657
|
@subsection Sample code
|
@@ -34679,7 +34672,7 @@ void func(double a)
|
|
34679
34672
|
|
34680
34673
|
@subsection Since
|
34681
34674
|
|
34682
|
-
|
34675
|
+
1.14.0
|
34683
34676
|
|
34684
34677
|
@node W1069
|
34685
34678
|
@section W1069
|
@@ -34691,14 +34684,21 @@ No trailing `else' clause is found in this `if-else-if' statements chain.
|
|
34691
34684
|
|
34692
34685
|
@subsection Content
|
34693
34686
|
|
34694
|
-
@b{This message will be supported in AdLint 2.0.0}
|
34695
|
-
|
34696
34687
|
Under construction.
|
34697
34688
|
|
34698
34689
|
@subsection Sample code
|
34699
34690
|
|
34700
34691
|
@verbatim
|
34701
|
-
|
34692
|
+
static int func(int i)
|
34693
|
+
{
|
34694
|
+
if (i == 2) { /* W1069 */
|
34695
|
+
return 0;
|
34696
|
+
}
|
34697
|
+
else if (i == 4) {
|
34698
|
+
return 1;
|
34699
|
+
}
|
34700
|
+
return 2;
|
34701
|
+
}
|
34702
34702
|
@end verbatim
|
34703
34703
|
|
34704
34704
|
@subsection Related message
|
@@ -34707,7 +34707,7 @@ None.
|
|
34707
34707
|
|
34708
34708
|
@subsection Since
|
34709
34709
|
|
34710
|
-
|
34710
|
+
1.14.0
|
34711
34711
|
|
34712
34712
|
@node W1070
|
34713
34713
|
@section W1070
|
@@ -34719,8 +34719,6 @@ This `switch' statement can be translated into `if-else' statement because there
|
|
34719
34719
|
|
34720
34720
|
@subsection Content
|
34721
34721
|
|
34722
|
-
@b{This message will be supported in AdLint 2.0.0}
|
34723
|
-
|
34724
34722
|
Under construction.
|
34725
34723
|
|
34726
34724
|
@subsection Sample code
|
@@ -34741,7 +34739,7 @@ None.
|
|
34741
34739
|
|
34742
34740
|
@subsection Since
|
34743
34741
|
|
34744
|
-
|
34742
|
+
1.14.0
|
34745
34743
|
|
34746
34744
|
@node W1071
|
34747
34745
|
@section W1071
|
@@ -34789,14 +34787,25 @@ None.
|
|
34789
34787
|
|
34790
34788
|
@subsection Content
|
34791
34789
|
|
34792
|
-
@b{This message will be supported in AdLint 2.0.0}
|
34793
|
-
|
34794
34790
|
Under construction.
|
34795
34791
|
|
34796
34792
|
@subsection Sample code
|
34797
34793
|
|
34798
34794
|
@verbatim
|
34799
|
-
|
34795
|
+
static int func(int i)
|
34796
|
+
{
|
34797
|
+
if (i == 1) {
|
34798
|
+
goto Label1; /* W1072 */
|
34799
|
+
}
|
34800
|
+
|
34801
|
+
goto Label2; /* W1072 */
|
34802
|
+
|
34803
|
+
Label1:
|
34804
|
+
i = 10;
|
34805
|
+
Label2:
|
34806
|
+
i = 20;
|
34807
|
+
return i;
|
34808
|
+
}
|
34800
34809
|
@end verbatim
|
34801
34810
|
|
34802
34811
|
@subsection Related message
|
@@ -34805,7 +34814,7 @@ None.
|
|
34805
34814
|
|
34806
34815
|
@subsection Since
|
34807
34816
|
|
34808
|
-
|
34817
|
+
1.14.0
|
34809
34818
|
|
34810
34819
|
@node W1073
|
34811
34820
|
@section W1073
|
@@ -35682,12 +35691,11 @@ MET,FN_RETN,bar,int bar(int),test.c,20,5,3
|
|
35682
35691
|
@cindex FN_UELS
|
35683
35692
|
|
35684
35693
|
@subsection Metric name
|
35685
|
-
|
35694
|
+
Number of @code{`if'} statement without @code{`else'} clause
|
35686
35695
|
|
35687
35696
|
@subsection Content
|
35688
35697
|
|
35689
|
-
The number of
|
35690
|
-
|
35698
|
+
The number of @code{`if'} statements which have no explicit @code{else} clause.
|
35691
35699
|
|
35692
35700
|
@subsection Sample code
|
35693
35701
|
|
@@ -35706,7 +35714,7 @@ int foo(int i)
|
|
35706
35714
|
if (j % 2) {
|
35707
35715
|
return -1;
|
35708
35716
|
}
|
35709
|
-
/*
|
35717
|
+
/* A standalone if-statement does nothing to the FN_UELS metric */
|
35710
35718
|
|
35711
35719
|
if (i == 2) {
|
35712
35720
|
return 0;
|
@@ -35718,12 +35726,12 @@ int foo(int i)
|
|
35718
35726
|
|
35719
35727
|
return 5;
|
35720
35728
|
|
35721
|
-
/* foo's FN_UELS ==
|
35729
|
+
/* foo's FN_UELS == 1 */
|
35722
35730
|
}
|
35723
35731
|
@end verbatim
|
35724
35732
|
|
35725
35733
|
@example
|
35726
|
-
MET,FN_UELS,foo,int foo(int),test.c,1,5,
|
35734
|
+
MET,FN_UELS,foo,int foo(int),test.c,1,5,1
|
35727
35735
|
@end example
|
35728
35736
|
|
35729
35737
|
@subsection Since
|