adlint 3.0.10 → 3.2.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 +67 -0
- data/MANIFEST +2 -0
- data/NEWS +10 -3
- data/etc/mesg.d/c_builtin/en_US/messages.yml +29 -1
- data/etc/mesg.d/c_builtin/ja_JP/messages.yml +29 -1
- data/etc/mesg.d/core/en_US/messages.yml +1 -1
- data/etc/mesg.d/core/ja_JP/messages.yml +1 -1
- data/features/code_check/W0003.feature +5 -0
- data/features/code_check/W0023.feature +32 -0
- data/features/code_check/W0024.feature +22 -0
- data/features/code_check/W0093.feature +71 -0
- data/features/code_check/W0097.feature +4 -0
- data/features/code_check/W0100.feature +10 -0
- data/features/code_check/W0119.feature +8 -0
- data/features/code_check/W0133.feature +8 -0
- data/features/code_check/W0134.feature +8 -0
- data/features/code_check/W0136.feature +8 -0
- data/features/code_check/W0138.feature +8 -0
- data/features/code_check/W0140.feature +8 -0
- data/features/code_check/W0142.feature +8 -0
- data/features/code_check/W0143.feature +8 -0
- data/features/code_check/W0144.feature +8 -0
- data/features/code_check/W0145.feature +8 -0
- data/features/code_check/W0146.feature +8 -0
- data/features/code_check/W0147.feature +8 -0
- data/features/code_check/W0148.feature +8 -0
- data/features/code_check/W0149.feature +8 -0
- data/features/code_check/W0150.feature +8 -0
- data/features/code_check/W0151.feature +8 -0
- data/features/code_check/W0152.feature +8 -0
- data/features/code_check/W0153.feature +8 -0
- data/features/code_check/W0154.feature +8 -0
- data/features/code_check/W0155.feature +8 -0
- data/features/code_check/W0156.feature +8 -0
- data/features/code_check/W0157.feature +8 -0
- data/features/code_check/W0158.feature +8 -0
- data/features/code_check/W0159.feature +8 -0
- data/features/code_check/W0160.feature +8 -0
- data/features/code_check/W0161.feature +8 -0
- data/features/code_check/W0162.feature +8 -0
- data/features/code_check/W0163.feature +8 -0
- data/features/code_check/W0164.feature +8 -0
- data/features/code_check/W0165.feature +8 -0
- data/features/code_check/W0166.feature +8 -0
- data/features/code_check/W0167.feature +8 -0
- data/features/code_check/W0168.feature +8 -0
- data/features/code_check/W0169.feature +8 -0
- data/features/code_check/W0170.feature +8 -0
- data/features/code_check/W0171.feature +8 -0
- data/features/code_check/W0172.feature +8 -0
- data/features/code_check/W0173.feature +8 -0
- data/features/code_check/W0174.feature +8 -0
- data/features/code_check/W0175.feature +8 -0
- data/features/code_check/W0176.feature +8 -0
- data/features/code_check/W0177.feature +8 -0
- data/features/code_check/W0178.feature +8 -0
- data/features/code_check/W0179.feature +8 -0
- data/features/code_check/W0180.feature +8 -0
- data/features/code_check/W0181.feature +8 -0
- data/features/code_check/W0250.feature +8 -0
- data/features/code_check/W0422.feature +194 -0
- data/features/code_check/W0459.feature +16 -0
- data/features/code_check/W0460.feature +342 -0
- data/features/code_check/W0461.feature +5 -0
- data/features/code_check/W0497.feature +12 -0
- data/features/code_check/W0499.feature +6 -0
- data/features/code_check/W0502.feature +6 -0
- data/features/code_check/W0570.feature +47 -0
- data/features/code_check/W0573.feature +8 -0
- data/features/code_check/W0582.feature +4 -0
- data/features/code_check/W0583.feature +4 -0
- data/features/code_check/W0584.feature +10 -0
- data/features/code_check/W0599.feature +10 -0
- data/features/code_check/W0644.feature +2 -0
- data/features/code_check/W0649.feature +14 -0
- data/features/code_check/W0650.feature +12 -0
- data/features/code_check/W0685.feature +10 -0
- data/features/code_check/W0686.feature +8 -0
- data/features/code_check/W0711.feature +2 -0
- data/features/code_check/W0712.feature +2 -0
- data/features/code_check/W0713.feature +2 -0
- data/features/code_check/W0714.feature +2 -0
- data/features/code_check/W0715.feature +2 -0
- data/features/code_check/W0718.feature +2 -0
- data/features/code_check/W0719.feature +8 -0
- data/features/code_check/W0732.feature +18 -0
- data/features/code_check/W0733.feature +18 -0
- data/features/code_check/W0734.feature +24 -0
- data/features/code_check/W0735.feature +24 -0
- data/features/code_check/W0747.feature +8 -0
- data/features/code_check/W0749.feature +8 -0
- data/features/code_check/W0750.feature +8 -0
- data/features/code_check/W0753.feature +8 -0
- data/features/code_check/W0754.feature +8 -0
- data/features/code_check/W0759.feature +8 -0
- data/features/code_check/W0760.feature +8 -0
- data/features/code_check/W0761.feature +8 -0
- data/features/code_check/W0762.feature +8 -0
- data/features/code_check/W0794.feature +6 -0
- data/features/code_check/W1050.feature +8 -0
- data/features/code_check/W1066.feature +8 -0
- data/features/code_check/W1067.feature +8 -0
- data/features/code_check/W1068.feature +8 -0
- data/features/code_check/W1071.feature +4 -0
- data/features/code_check/W9003.feature +2 -0
- data/lib/adlint/cc1.rb +1 -0
- data/lib/adlint/cc1/branch.rb +34 -13
- data/lib/adlint/cc1/conv.rb +3 -3
- data/lib/adlint/cc1/ctrlexpr.rb +12 -7
- data/lib/adlint/cc1/environ.rb +12 -2
- data/lib/adlint/cc1/expr.rb +10 -8
- data/lib/adlint/cc1/interp.rb +56 -49
- data/lib/adlint/cc1/mediator.rb +9 -5
- data/lib/adlint/cc1/object.rb +37 -34
- data/lib/adlint/cc1/trace.rb +287 -0
- data/lib/adlint/cc1/type.rb +15 -15
- data/lib/adlint/cc1/value.rb +823 -427
- data/lib/adlint/cpp/eval.rb +5 -2
- data/lib/adlint/cpp/source.rb +21 -22
- data/lib/adlint/exam/c_builtin/cc1_check.rb +1636 -1067
- data/lib/adlint/exam/c_builtin/cc1_check_shima.rb +28 -22
- data/lib/adlint/exam/c_builtin/cc1_code.rb +4 -4
- data/lib/adlint/exam/c_builtin/cc1_metric.rb +14 -14
- data/lib/adlint/location.rb +5 -7
- data/lib/adlint/metric.rb +2 -2
- data/lib/adlint/prelude.rb +6 -2
- data/lib/adlint/report.rb +2 -2
- data/lib/adlint/version.rb +3 -3
- data/share/doc/developers_guide_ja.html +10 -4
- data/share/doc/developers_guide_ja.texi +8 -2
- data/share/doc/users_guide_en.html +679 -72
- data/share/doc/users_guide_en.texi +557 -12
- data/share/doc/users_guide_ja.html +678 -74
- data/share/doc/users_guide_ja.texi +554 -13
- data/spec/adlint/cc1/ctrlexpr_spec.rb +20 -11
- data/spec/adlint/cc1/domain_spec.rb +9 -0
- metadata +4 -2
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
@setfilename users_guide_en.info
|
|
3
3
|
@documentlanguage en
|
|
4
4
|
@documentencoding utf-8
|
|
5
|
-
@settitle AdLint 3.0
|
|
5
|
+
@settitle AdLint 3.2.0 User's Guide
|
|
6
6
|
|
|
7
7
|
@copying
|
|
8
8
|
Copyright (C) 2010-2013, OGIS-RI Co.,Ltd.
|
|
@@ -3120,6 +3120,13 @@ context_line
|
|
|
3120
3120
|
* W9002::There is no line feed character at the end of file.
|
|
3121
3121
|
* W9003::An object typed `%s' is implicitly converted into an object of type `%s'.
|
|
3122
3122
|
* C0001::A warning is detected as a pair of this identifier `%s'.
|
|
3123
|
+
* C1000::Warning above is detected in the following context.
|
|
3124
|
+
* C1001::This controlling-expression is evaluated to be true.
|
|
3125
|
+
* C1002::This controlling-expression is evaluated to be false.
|
|
3126
|
+
* C1003::The problematic variable is defined here without initializer.
|
|
3127
|
+
* C1004::NULL value is assigned to the the problematic variable.
|
|
3128
|
+
* C1005::A value possibly be NULL is assigned to the problematic variable.
|
|
3129
|
+
* C1006::New value is assigned to the problematic variable.
|
|
3123
3130
|
@end menu
|
|
3124
3131
|
|
|
3125
3132
|
@node X0001
|
|
@@ -5569,7 +5576,12 @@ int func(int a, int b)
|
|
|
5569
5576
|
|
|
5570
5577
|
@subsection Related message
|
|
5571
5578
|
|
|
5572
|
-
|
|
5579
|
+
@itemize
|
|
5580
|
+
@item @ref{C1000} Warning above is detected in the following context.
|
|
5581
|
+
@item @ref{C1001} This controlling-expression is evaluated to be true.
|
|
5582
|
+
@item @ref{C1002} This controlling-expression is evaluated to be false.
|
|
5583
|
+
@item @ref{C1006} New value is assigned to the problematic variable.
|
|
5584
|
+
@end itemize
|
|
5573
5585
|
|
|
5574
5586
|
@subsection Since
|
|
5575
5587
|
|
|
@@ -5597,7 +5609,12 @@ int b = 10 / A; /* W0096 */
|
|
|
5597
5609
|
|
|
5598
5610
|
@subsection Related message
|
|
5599
5611
|
|
|
5600
|
-
|
|
5612
|
+
@itemize
|
|
5613
|
+
@item @ref{C1000} Warning above is detected in the following context.
|
|
5614
|
+
@item @ref{C1001} This controlling-expression is evaluated to be true.
|
|
5615
|
+
@item @ref{C1002} This controlling-expression is evaluated to be false.
|
|
5616
|
+
@item @ref{C1006} New value is assigned to the problematic variable.
|
|
5617
|
+
@end itemize
|
|
5601
5618
|
|
|
5602
5619
|
@subsection Since
|
|
5603
5620
|
|
|
@@ -5634,7 +5651,12 @@ int func(int a, int b)
|
|
|
5634
5651
|
|
|
5635
5652
|
@subsection Related message
|
|
5636
5653
|
|
|
5637
|
-
|
|
5654
|
+
@itemize
|
|
5655
|
+
@item @ref{C1000} Warning above is detected in the following context.
|
|
5656
|
+
@item @ref{C1001} This controlling-expression is evaluated to be true.
|
|
5657
|
+
@item @ref{C1002} This controlling-expression is evaluated to be false.
|
|
5658
|
+
@item @ref{C1006} New value is assigned to the problematic variable.
|
|
5659
|
+
@end itemize
|
|
5638
5660
|
|
|
5639
5661
|
@subsection Since
|
|
5640
5662
|
|
|
@@ -6037,6 +6059,10 @@ unsigned int func(unsigned int a)
|
|
|
6037
6059
|
|
|
6038
6060
|
@itemize
|
|
6039
6061
|
@item @ref{W0116} Unsigned left shift operator `<<' can be drop high-order bit.
|
|
6062
|
+
@item @ref{C1000} Warning above is detected in the following context.
|
|
6063
|
+
@item @ref{C1001} This controlling-expression is evaluated to be true.
|
|
6064
|
+
@item @ref{C1002} This controlling-expression is evaluated to be false.
|
|
6065
|
+
@item @ref{C1006} New value is assigned to the problematic variable.
|
|
6040
6066
|
@end itemize
|
|
6041
6067
|
|
|
6042
6068
|
@subsection Since
|
|
@@ -6070,6 +6096,10 @@ unsigned int func(unsigned int a)
|
|
|
6070
6096
|
|
|
6071
6097
|
@itemize
|
|
6072
6098
|
@item @ref{W0115} Unsigned left shift operator `<<' drop the high-order bit.
|
|
6099
|
+
@item @ref{C1000} Warning above is detected in the following context.
|
|
6100
|
+
@item @ref{C1001} This controlling-expression is evaluated to be true.
|
|
6101
|
+
@item @ref{C1002} This controlling-expression is evaluated to be false.
|
|
6102
|
+
@item @ref{C1006} New value is assigned to the problematic variable.
|
|
6073
6103
|
@end itemize
|
|
6074
6104
|
|
|
6075
6105
|
@subsection Since
|
|
@@ -22134,7 +22164,13 @@ void func(int a, int *p)
|
|
|
22134
22164
|
|
|
22135
22165
|
@subsection Related message
|
|
22136
22166
|
|
|
22137
|
-
|
|
22167
|
+
@itemize
|
|
22168
|
+
@item @ref{C1000} Warning above is detected in the following context.
|
|
22169
|
+
@item @ref{C1001} This controlling-expression is evaluated to be true.
|
|
22170
|
+
@item @ref{C1002} This controlling-expression is evaluated to be false.
|
|
22171
|
+
@item @ref{C1004} NULL value is assigned to the the problematic variable.
|
|
22172
|
+
@item @ref{C1005} A value possibly be NULL is assigned to the problematic variable.
|
|
22173
|
+
@end itemize
|
|
22138
22174
|
|
|
22139
22175
|
@subsection Since
|
|
22140
22176
|
|
|
@@ -22169,7 +22205,13 @@ void func(int a, int *p)
|
|
|
22169
22205
|
|
|
22170
22206
|
@subsection Related message
|
|
22171
22207
|
|
|
22172
|
-
|
|
22208
|
+
@itemize
|
|
22209
|
+
@item @ref{C1000} Warning above is detected in the following context.
|
|
22210
|
+
@item @ref{C1001} This controlling-expression is evaluated to be true.
|
|
22211
|
+
@item @ref{C1002} This controlling-expression is evaluated to be false.
|
|
22212
|
+
@item @ref{C1004} NULL value is assigned to the the problematic variable.
|
|
22213
|
+
@item @ref{C1005} A value possibly be NULL is assigned to the problematic variable.
|
|
22214
|
+
@end itemize
|
|
22173
22215
|
|
|
22174
22216
|
@subsection Since
|
|
22175
22217
|
|
|
@@ -22203,7 +22245,13 @@ int *func(int *p)
|
|
|
22203
22245
|
|
|
22204
22246
|
@subsection Related message
|
|
22205
22247
|
|
|
22206
|
-
|
|
22248
|
+
@itemize
|
|
22249
|
+
@item @ref{C1000} Warning above is detected in the following context.
|
|
22250
|
+
@item @ref{C1001} This controlling-expression is evaluated to be true.
|
|
22251
|
+
@item @ref{C1002} This controlling-expression is evaluated to be false.
|
|
22252
|
+
@item @ref{C1004} NULL value is assigned to the the problematic variable.
|
|
22253
|
+
@item @ref{C1005} A value possibly be NULL is assigned to the problematic variable.
|
|
22254
|
+
@end itemize
|
|
22207
22255
|
|
|
22208
22256
|
@subsection Since
|
|
22209
22257
|
|
|
@@ -22238,7 +22286,13 @@ int *func(int *p)
|
|
|
22238
22286
|
|
|
22239
22287
|
@subsection Related message
|
|
22240
22288
|
|
|
22241
|
-
|
|
22289
|
+
@itemize
|
|
22290
|
+
@item @ref{C1000} Warning above is detected in the following context.
|
|
22291
|
+
@item @ref{C1001} This controlling-expression is evaluated to be true.
|
|
22292
|
+
@item @ref{C1002} This controlling-expression is evaluated to be false.
|
|
22293
|
+
@item @ref{C1004} NULL value is assigned to the the problematic variable.
|
|
22294
|
+
@item @ref{C1005} A value possibly be NULL is assigned to the problematic variable.
|
|
22295
|
+
@end itemize
|
|
22242
22296
|
|
|
22243
22297
|
@subsection Since
|
|
22244
22298
|
|
|
@@ -22703,6 +22757,10 @@ if(a > 0) { /* W0459 */
|
|
|
22703
22757
|
@item @ref{W0460} A value of variable `%s' wouldn't set when this expression is evaluated.
|
|
22704
22758
|
@item @ref{W0461} A pointer which points the undetermined variable is used for the actual argument of the function. This program is danger.
|
|
22705
22759
|
@item @ref{W0462} A pointer which the value will probably not set is used for the actual argument of the function.
|
|
22760
|
+
@item @ref{C1000} Warning above is detected in the following context.
|
|
22761
|
+
@item @ref{C1001} This controlling-expression is evaluated to be true.
|
|
22762
|
+
@item @ref{C1002} This controlling-expression is evaluated to be false.
|
|
22763
|
+
@item @ref{C1003} The problematic variable is defined here without initializer.
|
|
22706
22764
|
@end itemize
|
|
22707
22765
|
|
|
22708
22766
|
@subsection Since
|
|
@@ -22743,6 +22801,10 @@ void func(int a)
|
|
|
22743
22801
|
@item @ref{W0459} A value of variable `%s' doesn't set when this expression is evaluated. This program is danger.
|
|
22744
22802
|
@item @ref{W0461} A pointer which points the undetermined variable is used for the actual argument of the function. This program is danger.
|
|
22745
22803
|
@item @ref{W0462} A pointer which the value will probably not set is used for the actual argument of the function.
|
|
22804
|
+
@item @ref{C1000} Warning above is detected in the following context.
|
|
22805
|
+
@item @ref{C1001} This controlling-expression is evaluated to be true.
|
|
22806
|
+
@item @ref{C1002} This controlling-expression is evaluated to be false.
|
|
22807
|
+
@item @ref{C1003} The problematic variable is defined here without initializer.
|
|
22746
22808
|
@end itemize
|
|
22747
22809
|
|
|
22748
22810
|
@subsection Since
|
|
@@ -22780,6 +22842,10 @@ void func2(int a)
|
|
|
22780
22842
|
@item @ref{W0459} A value of variable `%s' doesn't set when this expression is evaluated. This program is danger.
|
|
22781
22843
|
@item @ref{W0460} A value of variable `%s' wouldn't set when this expression is evaluated.
|
|
22782
22844
|
@item @ref{W0462} A pointer which the value will probably not set is used for the actual argument of the function.
|
|
22845
|
+
@item @ref{C1000} Warning above is detected in the following context.
|
|
22846
|
+
@item @ref{C1001} This controlling-expression is evaluated to be true.
|
|
22847
|
+
@item @ref{C1002} This controlling-expression is evaluated to be false.
|
|
22848
|
+
@item @ref{C1003} The problematic variable is defined here without initializer.
|
|
22783
22849
|
@end itemize
|
|
22784
22850
|
|
|
22785
22851
|
@subsection Since
|
|
@@ -22821,6 +22887,10 @@ int func2(int a)
|
|
|
22821
22887
|
@item @ref{W0459} A value of variable `%s' doesn't set when this expression is evaluated. This program is danger.
|
|
22822
22888
|
@item @ref{W0460} A value of variable `%s' wouldn't set when this expression is evaluated.
|
|
22823
22889
|
@item @ref{W0461} A pointer which points the undetermined variable is used for the actual argument of the function. This program is danger.
|
|
22890
|
+
@item @ref{C1000} Warning above is detected in the following context.
|
|
22891
|
+
@item @ref{C1001} This controlling-expression is evaluated to be true.
|
|
22892
|
+
@item @ref{C1002} This controlling-expression is evaluated to be false.
|
|
22893
|
+
@item @ref{C1003} The problematic variable is defined here without initializer.
|
|
22824
22894
|
@end itemize
|
|
22825
22895
|
|
|
22826
22896
|
@subsection Since
|
|
@@ -24654,6 +24724,10 @@ int b = -5 << 1; /* W0568 */
|
|
|
24654
24724
|
@itemize
|
|
24655
24725
|
@item @ref{W0569} The result of left shift operation against the signed expression value is undefined.
|
|
24656
24726
|
@item @ref{W0570} This signed left shift operation may make undefined value.
|
|
24727
|
+
@item @ref{C1000} Warning above is detected in the following context.
|
|
24728
|
+
@item @ref{C1001} This controlling-expression is evaluated to be true.
|
|
24729
|
+
@item @ref{C1002} This controlling-expression is evaluated to be false.
|
|
24730
|
+
@item @ref{C1006} New value is assigned to the problematic variable.
|
|
24657
24731
|
@end itemize
|
|
24658
24732
|
|
|
24659
24733
|
@subsection Since
|
|
@@ -24694,6 +24768,10 @@ int func(int a)
|
|
|
24694
24768
|
@itemize
|
|
24695
24769
|
@item @ref{W0568} The result of left shift operation against the signed constant expression value is undefined.
|
|
24696
24770
|
@item @ref{W0570} This signed left shift operation may make undefined value.
|
|
24771
|
+
@item @ref{C1000} Warning above is detected in the following context.
|
|
24772
|
+
@item @ref{C1001} This controlling-expression is evaluated to be true.
|
|
24773
|
+
@item @ref{C1002} This controlling-expression is evaluated to be false.
|
|
24774
|
+
@item @ref{C1006} New value is assigned to the problematic variable.
|
|
24697
24775
|
@end itemize
|
|
24698
24776
|
|
|
24699
24777
|
@subsection Since
|
|
@@ -24734,6 +24812,10 @@ int func(int a)
|
|
|
24734
24812
|
@itemize
|
|
24735
24813
|
@item @ref{W0568} The result of left shift operation against the signed constant expression value is undefined.
|
|
24736
24814
|
@item @ref{W0569} The result of left shift operation against the signed expression value is undefined.
|
|
24815
|
+
@item @ref{C1000} Warning above is detected in the following context.
|
|
24816
|
+
@item @ref{C1001} This controlling-expression is evaluated to be true.
|
|
24817
|
+
@item @ref{C1002} This controlling-expression is evaluated to be false.
|
|
24818
|
+
@item @ref{C1006} New value is assigned to the problematic variable.
|
|
24737
24819
|
@end itemize
|
|
24738
24820
|
|
|
24739
24821
|
@subsection Since
|
|
@@ -25674,6 +25756,10 @@ void func(int a)
|
|
|
25674
25756
|
|
|
25675
25757
|
@itemize
|
|
25676
25758
|
@item @ref{W0608} An integer expression which the value might be minus converted to unsigned type.
|
|
25759
|
+
@item @ref{C1000} Warning above is detected in the following context.
|
|
25760
|
+
@item @ref{C1001} This controlling-expression is evaluated to be true.
|
|
25761
|
+
@item @ref{C1002} This controlling-expression is evaluated to be false.
|
|
25762
|
+
@item @ref{C1006} New value is assigned to the problematic variable.
|
|
25677
25763
|
@end itemize
|
|
25678
25764
|
|
|
25679
25765
|
@subsection Since
|
|
@@ -25709,6 +25795,10 @@ void fuu(int a)
|
|
|
25709
25795
|
|
|
25710
25796
|
@itemize
|
|
25711
25797
|
@item @ref{W0607} An integer expression which the value which the value is minus converted to unsigned type.
|
|
25798
|
+
@item @ref{C1000} Warning above is detected in the following context.
|
|
25799
|
+
@item @ref{C1001} This controlling-expression is evaluated to be true.
|
|
25800
|
+
@item @ref{C1002} This controlling-expression is evaluated to be false.
|
|
25801
|
+
@item @ref{C1006} New value is assigned to the problematic variable.
|
|
25712
25802
|
@end itemize
|
|
25713
25803
|
|
|
25714
25804
|
@subsection Since
|
|
@@ -29368,7 +29458,12 @@ void func(unsigned int a)
|
|
|
29368
29458
|
|
|
29369
29459
|
@subsection Related message
|
|
29370
29460
|
|
|
29371
|
-
|
|
29461
|
+
@itemize
|
|
29462
|
+
@item @ref{C1000} Warning above is detected in the following context.
|
|
29463
|
+
@item @ref{C1001} This controlling-expression is evaluated to be true.
|
|
29464
|
+
@item @ref{C1002} This controlling-expression is evaluated to be false.
|
|
29465
|
+
@item @ref{C1006} New value is assigned to the problematic variable.
|
|
29466
|
+
@end itemize
|
|
29372
29467
|
|
|
29373
29468
|
@subsection Since
|
|
29374
29469
|
|
|
@@ -29400,7 +29495,12 @@ int foo(void)
|
|
|
29400
29495
|
|
|
29401
29496
|
@subsection Related message
|
|
29402
29497
|
|
|
29403
|
-
|
|
29498
|
+
@itemize
|
|
29499
|
+
@item @ref{C1000} Warning above is detected in the following context.
|
|
29500
|
+
@item @ref{C1001} This controlling-expression is evaluated to be true.
|
|
29501
|
+
@item @ref{C1002} This controlling-expression is evaluated to be false.
|
|
29502
|
+
@item @ref{C1006} New value is assigned to the problematic variable.
|
|
29503
|
+
@end itemize
|
|
29404
29504
|
|
|
29405
29505
|
@subsection Since
|
|
29406
29506
|
|
|
@@ -29756,7 +29856,12 @@ signed char sc4 = (signed char) -129.5; /* W0720 */
|
|
|
29756
29856
|
|
|
29757
29857
|
@subsection Related message
|
|
29758
29858
|
|
|
29759
|
-
|
|
29859
|
+
@itemize
|
|
29860
|
+
@item @ref{C1000} Warning above is detected in the following context.
|
|
29861
|
+
@item @ref{C1001} This controlling-expression is evaluated to be true.
|
|
29862
|
+
@item @ref{C1002} This controlling-expression is evaluated to be false.
|
|
29863
|
+
@item @ref{C1006} New value is assigned to the problematic variable.
|
|
29864
|
+
@end itemize
|
|
29760
29865
|
|
|
29761
29866
|
@subsection Since
|
|
29762
29867
|
|
|
@@ -30583,7 +30688,12 @@ void func(unsigned int a)
|
|
|
30583
30688
|
|
|
30584
30689
|
@subsection Related message
|
|
30585
30690
|
|
|
30586
|
-
|
|
30691
|
+
@itemize
|
|
30692
|
+
@item @ref{C1000} Warning above is detected in the following context.
|
|
30693
|
+
@item @ref{C1001} This controlling-expression is evaluated to be true.
|
|
30694
|
+
@item @ref{C1002} This controlling-expression is evaluated to be false.
|
|
30695
|
+
@item @ref{C1006} New value is assigned to the problematic variable.
|
|
30696
|
+
@end itemize
|
|
30587
30697
|
|
|
30588
30698
|
@subsection Since
|
|
30589
30699
|
|
|
@@ -34128,6 +34238,10 @@ void func(unsigned int ui)
|
|
|
34128
34238
|
@item @ref{W1050} The result of conversion to signed integer type in integer expression is not express by a signed type.
|
|
34129
34239
|
@item @ref{W1051} The result of unsigned arithmetic expression typed `%s' is going around 0 by overflow.
|
|
34130
34240
|
@item @ref{W1052} The result of unsigned arithmetic expression typed `%s' can be going around by overflow.
|
|
34241
|
+
@item @ref{C1000} Warning above is detected in the following context.
|
|
34242
|
+
@item @ref{C1001} This controlling-expression is evaluated to be true.
|
|
34243
|
+
@item @ref{C1002} This controlling-expression is evaluated to be false.
|
|
34244
|
+
@item @ref{C1006} New value is assigned to the problematic variable.
|
|
34131
34245
|
@end itemize
|
|
34132
34246
|
|
|
34133
34247
|
@subsection Since
|
|
@@ -34174,6 +34288,10 @@ void func(unsigned int ui)
|
|
|
34174
34288
|
@item @ref{W1049} The result of conversion to signed integer type in integer expression might not be expressed by a signed type.
|
|
34175
34289
|
@item @ref{W1051} The result of unsigned arithmetic expression typed `%s' is going around 0 by overflow.
|
|
34176
34290
|
@item @ref{W1052} The result of unsigned arithmetic expression typed `%s' can be going around by overflow.
|
|
34291
|
+
@item @ref{C1000} Warning above is detected in the following context.
|
|
34292
|
+
@item @ref{C1001} This controlling-expression is evaluated to be true.
|
|
34293
|
+
@item @ref{C1002} This controlling-expression is evaluated to be false.
|
|
34294
|
+
@item @ref{C1006} New value is assigned to the problematic variable.
|
|
34177
34295
|
@end itemize
|
|
34178
34296
|
|
|
34179
34297
|
@subsection Since
|
|
@@ -35393,6 +35511,433 @@ int very_long_long_long_long_long_long_long_identifier_2 = 1; /* W0052 */
|
|
|
35393
35511
|
|
|
35394
35512
|
1.0.0
|
|
35395
35513
|
|
|
35514
|
+
@node C1000
|
|
35515
|
+
@section C1000
|
|
35516
|
+
@cindex C1000
|
|
35517
|
+
|
|
35518
|
+
@subsection Message body
|
|
35519
|
+
|
|
35520
|
+
Warning above is detected in the following context.
|
|
35521
|
+
|
|
35522
|
+
@subsection Content
|
|
35523
|
+
|
|
35524
|
+
This message indicates that the above @ref{W0093,W0093}, @ref{W0096,W0096},
|
|
35525
|
+
@ref{W0097,W0097}, @ref{W0115,W0115}, @ref{W0116,W0116}, @ref{W0421,W0421},
|
|
35526
|
+
@ref{W0422,W0422}, @ref{W0423,W0423}, @ref{W0424,W0424}, @ref{W0459,W0459},
|
|
35527
|
+
@ref{W0460,W0460}, @ref{W0461,W0461}, @ref{W0462,W0462}, @ref{W0568,W0568},
|
|
35528
|
+
@ref{W0569,W0569}, @ref{W0570,W0570}, @ref{W0607,W0607}, @ref{W0608,W0608},
|
|
35529
|
+
@ref{W0705,W0705}, @ref{W0707,W0707}, @ref{W0720,W0720}, @ref{W0745,W0745},
|
|
35530
|
+
@ref{W1049,W1049} and @ref{W1050,W1050} warnings are detected in the context
|
|
35531
|
+
described by the following messages.
|
|
35532
|
+
|
|
35533
|
+
@subsection Sample code
|
|
35534
|
+
|
|
35535
|
+
@verbatim
|
|
35536
|
+
1: int foo(int i)
|
|
35537
|
+
2: {
|
|
35538
|
+
3: int j; /* C1003 */
|
|
35539
|
+
4:
|
|
35540
|
+
5: if (i < 0) { /* C1001 */
|
|
35541
|
+
6: if (i < -10) { /* C1002 */
|
|
35542
|
+
7: j = 2;
|
|
35543
|
+
8: }
|
|
35544
|
+
9: else if (i < -5) { /* C1002 */
|
|
35545
|
+
10: j = 3;
|
|
35546
|
+
11: }
|
|
35547
|
+
12: }
|
|
35548
|
+
13: else {
|
|
35549
|
+
14: j = 1;
|
|
35550
|
+
15: }
|
|
35551
|
+
16:
|
|
35552
|
+
17: return j; /* W0460 */
|
|
35553
|
+
18: }
|
|
35554
|
+
|
|
35555
|
+
a.c:17:12:warning:c_builtin:W0460:UNC:X99:A value of variable `j' wouldn't set when this expression is evaluated.
|
|
35556
|
+
:::context:c_builtin:C1000:INF:X99:Warning above is detected in the following context.
|
|
35557
|
+
a.c:3:9:context:c_builtin:C1003:INF:X99:The problematic variable is defined here without initializer.
|
|
35558
|
+
a.c:5:11:context:c_builtin:C1001:INF:X99:This controlling-expression is evaluated to be true.
|
|
35559
|
+
a.c:6:15:context:c_builtin:C1002:INF:X99:This controlling-expression is evaluated to be false.
|
|
35560
|
+
a.c:9:20:context:c_builtin:C1002:INF:X99:This controlling-expression is evaluated to be false.
|
|
35561
|
+
@end verbatim
|
|
35562
|
+
|
|
35563
|
+
@subsection Related message
|
|
35564
|
+
|
|
35565
|
+
@itemize
|
|
35566
|
+
@item @ref{C1001} This controlling-expression is evaluated to be true.
|
|
35567
|
+
@item @ref{C1002} This controlling-expression is evaluated to be false.
|
|
35568
|
+
@item @ref{C1003} The problematic variable is defined here without initializer.
|
|
35569
|
+
@item @ref{C1004} NULL value is assigned to the the problematic variable.
|
|
35570
|
+
@item @ref{C1005} A value possibly be NULL is assigned to the problematic variable.
|
|
35571
|
+
@item @ref{C1006} New value is assigned to the problematic variable.
|
|
35572
|
+
@end itemize
|
|
35573
|
+
|
|
35574
|
+
@subsection Since
|
|
35575
|
+
|
|
35576
|
+
3.2.0
|
|
35577
|
+
|
|
35578
|
+
@node C1001
|
|
35579
|
+
@section C1001
|
|
35580
|
+
@cindex C1001
|
|
35581
|
+
|
|
35582
|
+
@subsection Message body
|
|
35583
|
+
|
|
35584
|
+
This controlling-expression is evaluated to be true.
|
|
35585
|
+
|
|
35586
|
+
@subsection Content
|
|
35587
|
+
|
|
35588
|
+
This message indicates that the controlling-expression was evaluated as true in
|
|
35589
|
+
the context of detecting @ref{W0093,W0093}, @ref{W0096,W0096},
|
|
35590
|
+
@ref{W0097,W0097}, @ref{W0115,W0115}, @ref{W0116,W0116}, @ref{W0421,W0421},
|
|
35591
|
+
@ref{W0422,W0422}, @ref{W0423,W0423}, @ref{W0424,W0424}, @ref{W0459,W0459},
|
|
35592
|
+
@ref{W0460,W0460}, @ref{W0461,W0461}, @ref{W0462,W0462}, @ref{W0568,W0568},
|
|
35593
|
+
@ref{W0569,W0569}, @ref{W0570,W0570}, @ref{W0607,W0607}, @ref{W0608,W0608},
|
|
35594
|
+
@ref{W0705,W0705}, @ref{W0707,W0707}, @ref{W0720,W0720}, @ref{W0745,W0745},
|
|
35595
|
+
@ref{W1049,W1049} and @ref{W1050,W1050} warnings.
|
|
35596
|
+
|
|
35597
|
+
@subsection Sample code
|
|
35598
|
+
|
|
35599
|
+
@verbatim
|
|
35600
|
+
int foo(int i)
|
|
35601
|
+
{
|
|
35602
|
+
int j; /* C1003 */
|
|
35603
|
+
|
|
35604
|
+
if (i < 0) { /* C1001 */
|
|
35605
|
+
if (i < -10) { /* C1002 */
|
|
35606
|
+
j = 2;
|
|
35607
|
+
}
|
|
35608
|
+
else if (i < -5) { /* C1002 */
|
|
35609
|
+
j = 3;
|
|
35610
|
+
}
|
|
35611
|
+
}
|
|
35612
|
+
else {
|
|
35613
|
+
j = 1;
|
|
35614
|
+
}
|
|
35615
|
+
|
|
35616
|
+
return j; /* W0460 */
|
|
35617
|
+
}
|
|
35618
|
+
@end verbatim
|
|
35619
|
+
|
|
35620
|
+
@subsection Related message
|
|
35621
|
+
|
|
35622
|
+
@itemize
|
|
35623
|
+
@item @ref{W0093} This expression may cause division-by-zero.
|
|
35624
|
+
@item @ref{W0096} It divided by a constant expression which definitely zero.
|
|
35625
|
+
@item @ref{W0097} This expression must cause division-by-zero.
|
|
35626
|
+
@item @ref{W0115} Unsigned left shift operator `<<' drop the high-order bit.
|
|
35627
|
+
@item @ref{W0116} Unsigned left shift operator `<<' can be drop high-order bit.
|
|
35628
|
+
@item @ref{W0421} Value of the dereferencing pointer must be NULL.
|
|
35629
|
+
@item @ref{W0422} Value of the dereferencing pointer may be NULL.
|
|
35630
|
+
@item @ref{W0423} Arithmetic operation is being made to the pointer which its value will be NULL.
|
|
35631
|
+
@item @ref{W0424} Arithmetic operation is being made to the pointer which its value might be NULL.
|
|
35632
|
+
@item @ref{W0459} A value of variable `%s' doesn't set when this expression is evaluated. This program is danger.
|
|
35633
|
+
@item @ref{W0460} A value of variable `%s' wouldn't set when this expression is evaluated.
|
|
35634
|
+
@item @ref{W0461} A pointer which points the undetermined variable is used for the actual argument of the function. This program is danger.
|
|
35635
|
+
@item @ref{W0462} A pointer which the value will probably not set is used for the actual argument of the function.
|
|
35636
|
+
@item @ref{W0568} The result of left shift operation against the signed constant expression value is undefined.
|
|
35637
|
+
@item @ref{W0569} The result of left shift operation against the signed expression value is undefined.
|
|
35638
|
+
@item @ref{W0570} This signed left shift operation may make undefined value.
|
|
35639
|
+
@item @ref{W0607} An integer expression which the value which the value is minus converted to unsigned type.
|
|
35640
|
+
@item @ref{W0608} An integer expression which the value might be minus converted to unsigned type.
|
|
35641
|
+
@item @ref{W0705} This non-constant array subscript may cause out-of-range access.
|
|
35642
|
+
@item @ref{W0707} This constant array subscript must cause out-of-range access.
|
|
35643
|
+
@item @ref{W0720} The value with floating-point type doesn't fit in the range of converted type.
|
|
35644
|
+
@item @ref{W0745} This non-constant array subscript may cause out-of-range access.
|
|
35645
|
+
@item @ref{W1049} The result of conversion to signed integer type in integer expression might not be expressed by a signed type.
|
|
35646
|
+
@item @ref{W1050} The result of conversion to signed integer type in integer expression is not express by a signed type.
|
|
35647
|
+
@end itemize
|
|
35648
|
+
|
|
35649
|
+
@subsection Since
|
|
35650
|
+
|
|
35651
|
+
3.2.0
|
|
35652
|
+
|
|
35653
|
+
@node C1002
|
|
35654
|
+
@section C1002
|
|
35655
|
+
@cindex C1002
|
|
35656
|
+
|
|
35657
|
+
@subsection Message body
|
|
35658
|
+
|
|
35659
|
+
This controlling-expression is evaluated to be false.
|
|
35660
|
+
|
|
35661
|
+
@subsection Content
|
|
35662
|
+
|
|
35663
|
+
This message indicates that the controlling-expression was evaluated as false
|
|
35664
|
+
in the context of detecting @ref{W0093,W0093}, @ref{W0096,W0096},
|
|
35665
|
+
@ref{W0097,W0097}, @ref{W0115,W0115}, @ref{W0116,W0116}, @ref{W0421,W0421},
|
|
35666
|
+
@ref{W0422,W0422}, @ref{W0423,W0423}, @ref{W0424,W0424}, @ref{W0459,W0459},
|
|
35667
|
+
@ref{W0460,W0460}, @ref{W0461,W0461}, @ref{W0462,W0462}, @ref{W0568,W0568},
|
|
35668
|
+
@ref{W0569,W0569}, @ref{W0570,W0570}, @ref{W0607,W0607}, @ref{W0608,W0608},
|
|
35669
|
+
@ref{W0705,W0705}, @ref{W0707,W0707}, @ref{W0720,W0720}, @ref{W0745,W0745},
|
|
35670
|
+
@ref{W1049,W1049} and @ref{W1050,W1050} warnings.
|
|
35671
|
+
|
|
35672
|
+
@subsection Sample code
|
|
35673
|
+
|
|
35674
|
+
@verbatim
|
|
35675
|
+
int foo(int i)
|
|
35676
|
+
{
|
|
35677
|
+
int j; /* C1003 */
|
|
35678
|
+
|
|
35679
|
+
if (i < 0) { /* C1001 */
|
|
35680
|
+
if (i < -10) { /* C1002 */
|
|
35681
|
+
j = 2;
|
|
35682
|
+
}
|
|
35683
|
+
else if (i < -5) { /* C1002 */
|
|
35684
|
+
j = 3;
|
|
35685
|
+
}
|
|
35686
|
+
}
|
|
35687
|
+
else {
|
|
35688
|
+
j = 1;
|
|
35689
|
+
}
|
|
35690
|
+
|
|
35691
|
+
return j; /* W0460 */
|
|
35692
|
+
}
|
|
35693
|
+
@end verbatim
|
|
35694
|
+
|
|
35695
|
+
@subsection Related message
|
|
35696
|
+
|
|
35697
|
+
@itemize
|
|
35698
|
+
@item @ref{W0093} This expression may cause division-by-zero.
|
|
35699
|
+
@item @ref{W0096} It divided by a constant expression which definitely zero.
|
|
35700
|
+
@item @ref{W0097} This expression must cause division-by-zero.
|
|
35701
|
+
@item @ref{W0115} Unsigned left shift operator `<<' drop the high-order bit.
|
|
35702
|
+
@item @ref{W0116} Unsigned left shift operator `<<' can be drop high-order bit.
|
|
35703
|
+
@item @ref{W0421} Value of the dereferencing pointer must be NULL.
|
|
35704
|
+
@item @ref{W0422} Value of the dereferencing pointer may be NULL.
|
|
35705
|
+
@item @ref{W0423} Arithmetic operation is being made to the pointer which its value will be NULL.
|
|
35706
|
+
@item @ref{W0424} Arithmetic operation is being made to the pointer which its value might be NULL.
|
|
35707
|
+
@item @ref{W0459} A value of variable `%s' doesn't set when this expression is evaluated. This program is danger.
|
|
35708
|
+
@item @ref{W0460} A value of variable `%s' wouldn't set when this expression is evaluated.
|
|
35709
|
+
@item @ref{W0461} A pointer which points the undetermined variable is used for the actual argument of the function. This program is danger.
|
|
35710
|
+
@item @ref{W0462} A pointer which the value will probably not set is used for the actual argument of the function.
|
|
35711
|
+
@item @ref{W0568} The result of left shift operation against the signed constant expression value is undefined.
|
|
35712
|
+
@item @ref{W0569} The result of left shift operation against the signed expression value is undefined.
|
|
35713
|
+
@item @ref{W0570} This signed left shift operation may make undefined value.
|
|
35714
|
+
@item @ref{W0607} An integer expression which the value which the value is minus converted to unsigned type.
|
|
35715
|
+
@item @ref{W0608} An integer expression which the value might be minus converted to unsigned type.
|
|
35716
|
+
@item @ref{W0705} This non-constant array subscript may cause out-of-range access.
|
|
35717
|
+
@item @ref{W0707} This constant array subscript must cause out-of-range access.
|
|
35718
|
+
@item @ref{W0720} The value with floating-point type doesn't fit in the range of converted type.
|
|
35719
|
+
@item @ref{W0745} This non-constant array subscript may cause out-of-range access.
|
|
35720
|
+
@item @ref{W1049} The result of conversion to signed integer type in integer expression might not be expressed by a signed type.
|
|
35721
|
+
@item @ref{W1050} The result of conversion to signed integer type in integer expression is not express by a signed type.
|
|
35722
|
+
@end itemize
|
|
35723
|
+
|
|
35724
|
+
@subsection Since
|
|
35725
|
+
|
|
35726
|
+
3.2.0
|
|
35727
|
+
|
|
35728
|
+
@node C1003
|
|
35729
|
+
@section C1003
|
|
35730
|
+
@cindex C1003
|
|
35731
|
+
|
|
35732
|
+
@subsection Message body
|
|
35733
|
+
|
|
35734
|
+
The problematic variable is defined here without initializer.
|
|
35735
|
+
|
|
35736
|
+
@subsection Content
|
|
35737
|
+
|
|
35738
|
+
This message indicates where the problematic variable is defined in the context
|
|
35739
|
+
of detecting @ref{W0459,W0459}, @ref{W0460,W0460}, @ref{W0461,W0461} and
|
|
35740
|
+
@ref{W0462,W0462} warnings.
|
|
35741
|
+
|
|
35742
|
+
@subsection Sample code
|
|
35743
|
+
|
|
35744
|
+
@verbatim
|
|
35745
|
+
int foo(int i)
|
|
35746
|
+
{
|
|
35747
|
+
int j; /* C1003 */
|
|
35748
|
+
|
|
35749
|
+
if (i < 0) { /* C1001 */
|
|
35750
|
+
if (i < -10) { /* C1002 */
|
|
35751
|
+
j = 2;
|
|
35752
|
+
}
|
|
35753
|
+
else if (i < -5) { /* C1002 */
|
|
35754
|
+
j = 3;
|
|
35755
|
+
}
|
|
35756
|
+
}
|
|
35757
|
+
else {
|
|
35758
|
+
j = 1;
|
|
35759
|
+
}
|
|
35760
|
+
|
|
35761
|
+
return j; /* W0460 */
|
|
35762
|
+
}
|
|
35763
|
+
@end verbatim
|
|
35764
|
+
|
|
35765
|
+
@subsection Related message
|
|
35766
|
+
|
|
35767
|
+
@itemize
|
|
35768
|
+
@item @ref{W0459} A value of variable `%s' doesn't set when this expression is evaluated. This program is danger.
|
|
35769
|
+
@item @ref{W0460} A value of variable `%s' wouldn't set when this expression is evaluated.
|
|
35770
|
+
@item @ref{W0461} A pointer which points the undetermined variable is used for the actual argument of the function. This program is danger.
|
|
35771
|
+
@item @ref{W0462} A pointer which the value will probably not set is used for the actual argument of the function.
|
|
35772
|
+
@end itemize
|
|
35773
|
+
|
|
35774
|
+
@subsection Since
|
|
35775
|
+
|
|
35776
|
+
3.2.0
|
|
35777
|
+
|
|
35778
|
+
@node C1004
|
|
35779
|
+
@section C1004
|
|
35780
|
+
@cindex C1004
|
|
35781
|
+
|
|
35782
|
+
@subsection Message body
|
|
35783
|
+
|
|
35784
|
+
NULL value is assigned to the the problematic variable.
|
|
35785
|
+
|
|
35786
|
+
@subsection Content
|
|
35787
|
+
|
|
35788
|
+
This message indicates where the NULL value was assigned to the problematic
|
|
35789
|
+
variable in the context of detecting @ref{W0421,W0421}, @ref{W0422,W0422},
|
|
35790
|
+
@ref{W0423,W0423} and @ref{W0424,W0424} warnings.
|
|
35791
|
+
|
|
35792
|
+
@subsection Sample code
|
|
35793
|
+
|
|
35794
|
+
@verbatim
|
|
35795
|
+
extern int *bar(void);
|
|
35796
|
+
extern int *baz(void);
|
|
35797
|
+
|
|
35798
|
+
void foo(int i)
|
|
35799
|
+
{
|
|
35800
|
+
int *p = NULL; /* C1004 */
|
|
35801
|
+
|
|
35802
|
+
if (i < 0) { /* C1002 */
|
|
35803
|
+
p = bar();
|
|
35804
|
+
if (!p) {
|
|
35805
|
+
return;
|
|
35806
|
+
}
|
|
35807
|
+
}
|
|
35808
|
+
else {
|
|
35809
|
+
p = baz(); /* C1005 */
|
|
35810
|
+
}
|
|
35811
|
+
|
|
35812
|
+
*p += 2; /* W0422 */
|
|
35813
|
+
}
|
|
35814
|
+
@end verbatim
|
|
35815
|
+
|
|
35816
|
+
@subsection Related message
|
|
35817
|
+
|
|
35818
|
+
@itemize
|
|
35819
|
+
@item @ref{W0421} Value of the dereferencing pointer must be NULL.
|
|
35820
|
+
@item @ref{W0422} Value of the dereferencing pointer may be NULL.
|
|
35821
|
+
@item @ref{W0423} Arithmetic operation is being made to the pointer which its value will be NULL.
|
|
35822
|
+
@item @ref{W0424} Arithmetic operation is being made to the pointer which its value might be NULL.
|
|
35823
|
+
@end itemize
|
|
35824
|
+
|
|
35825
|
+
@subsection Since
|
|
35826
|
+
|
|
35827
|
+
3.2.0
|
|
35828
|
+
|
|
35829
|
+
@node C1005
|
|
35830
|
+
@section C1005
|
|
35831
|
+
@cindex C1005
|
|
35832
|
+
|
|
35833
|
+
@subsection Message body
|
|
35834
|
+
|
|
35835
|
+
A value possibly be NULL is assigned to the problematic variable.
|
|
35836
|
+
|
|
35837
|
+
@subsection Content
|
|
35838
|
+
|
|
35839
|
+
This message indicates where the value possibly be NULL was assigned to the
|
|
35840
|
+
problematic variable in the context of detecting @ref{W0421,W0421},
|
|
35841
|
+
@ref{W0422,W0422}, @ref{W0423,W0423} and @ref{W0424,W0424} warnings.
|
|
35842
|
+
|
|
35843
|
+
@subsection Sample code
|
|
35844
|
+
|
|
35845
|
+
@verbatim
|
|
35846
|
+
extern int *bar(void);
|
|
35847
|
+
extern int *baz(void);
|
|
35848
|
+
|
|
35849
|
+
void foo(int i)
|
|
35850
|
+
{
|
|
35851
|
+
int *p = NULL; /* C1004 */
|
|
35852
|
+
|
|
35853
|
+
if (i < 0) { /* C1002 */
|
|
35854
|
+
p = bar();
|
|
35855
|
+
if (!p) {
|
|
35856
|
+
return;
|
|
35857
|
+
}
|
|
35858
|
+
}
|
|
35859
|
+
else {
|
|
35860
|
+
p = baz(); /* C1005 */
|
|
35861
|
+
}
|
|
35862
|
+
|
|
35863
|
+
*p += 2; /* W0422 */
|
|
35864
|
+
}
|
|
35865
|
+
@end verbatim
|
|
35866
|
+
|
|
35867
|
+
@subsection Related message
|
|
35868
|
+
|
|
35869
|
+
@itemize
|
|
35870
|
+
@item @ref{W0421} Value of the dereferencing pointer must be NULL.
|
|
35871
|
+
@item @ref{W0422} Value of the dereferencing pointer may be NULL.
|
|
35872
|
+
@item @ref{W0423} Arithmetic operation is being made to the pointer which its value will be NULL.
|
|
35873
|
+
@item @ref{W0424} Arithmetic operation is being made to the pointer which its value might be NULL.
|
|
35874
|
+
@end itemize
|
|
35875
|
+
|
|
35876
|
+
@subsection Since
|
|
35877
|
+
|
|
35878
|
+
3.2.0
|
|
35879
|
+
|
|
35880
|
+
@node C1006
|
|
35881
|
+
@section C1006
|
|
35882
|
+
@cindex C1006
|
|
35883
|
+
|
|
35884
|
+
@subsection Message body
|
|
35885
|
+
|
|
35886
|
+
New value is assigned to the problematic variable.
|
|
35887
|
+
|
|
35888
|
+
@subsection Content
|
|
35889
|
+
|
|
35890
|
+
This message indicates where a value was assigned to the problematic variable
|
|
35891
|
+
in the context of detecting @ref{W0093,W0093}, @ref{W0096,W0096},
|
|
35892
|
+
@ref{W0097,W0097}, @ref{W0115,W0115}, @ref{W0116,W0116}, @ref{W0568,W0568},
|
|
35893
|
+
@ref{W0569,W0569}, @ref{W0570,W0570}, @ref{W0607,W0607}, @ref{W0608,W0608},
|
|
35894
|
+
@ref{W0705,W0705}, @ref{W0707,W0707}, @ref{W0720,W0720}, @ref{W0745,W0745},
|
|
35895
|
+
@ref{W1049,W1049} and @ref{W1050,W1050} warnings.
|
|
35896
|
+
|
|
35897
|
+
@subsection Sample code
|
|
35898
|
+
|
|
35899
|
+
@verbatim
|
|
35900
|
+
int foo(int i)
|
|
35901
|
+
{
|
|
35902
|
+
int j = 0; /* C1006 */
|
|
35903
|
+
|
|
35904
|
+
if (i < 0) { /* C1002 */
|
|
35905
|
+
j = -i;
|
|
35906
|
+
}
|
|
35907
|
+
else if (i > 0) { /* C1002 */
|
|
35908
|
+
j = i;
|
|
35909
|
+
}
|
|
35910
|
+
|
|
35911
|
+
return 5 / j; /* W0093 */
|
|
35912
|
+
}
|
|
35913
|
+
@end verbatim
|
|
35914
|
+
|
|
35915
|
+
@subsection Related message
|
|
35916
|
+
|
|
35917
|
+
@itemize
|
|
35918
|
+
@item @ref{W0093} This expression may cause division-by-zero.
|
|
35919
|
+
@item @ref{W0096} It divided by a constant expression which definitely zero.
|
|
35920
|
+
@item @ref{W0097} This expression must cause division-by-zero.
|
|
35921
|
+
@item @ref{W0115} Unsigned left shift operator `<<' drop the high-order bit.
|
|
35922
|
+
@item @ref{W0116} Unsigned left shift operator `<<' can be drop high-order bit.
|
|
35923
|
+
@item @ref{W0568} The result of left shift operation against the signed constant expression value is undefined.
|
|
35924
|
+
@item @ref{W0569} The result of left shift operation against the signed expression value is undefined.
|
|
35925
|
+
@item @ref{W0570} This signed left shift operation may make undefined value.
|
|
35926
|
+
@item @ref{W0607} An integer expression which the value which the value is minus converted to unsigned type.
|
|
35927
|
+
@item @ref{W0608} An integer expression which the value might be minus converted to unsigned type.
|
|
35928
|
+
@item @ref{W0705} This non-constant array subscript may cause out-of-range access.
|
|
35929
|
+
@item @ref{W0707} This constant array subscript must cause out-of-range access.
|
|
35930
|
+
@item @ref{W0720} The value with floating-point type doesn't fit in the range of converted type.
|
|
35931
|
+
@item @ref{W0745} This non-constant array subscript may cause out-of-range access.
|
|
35932
|
+
@item @ref{W1049} The result of conversion to signed integer type in integer expression might not be expressed by a signed type.
|
|
35933
|
+
@item @ref{W1050} The result of conversion to signed integer type in integer expression is not express by a signed type.
|
|
35934
|
+
@end itemize
|
|
35935
|
+
|
|
35936
|
+
@subsection Since
|
|
35937
|
+
|
|
35938
|
+
3.2.0
|
|
35939
|
+
|
|
35940
|
+
|
|
35396
35941
|
@node Metrics
|
|
35397
35942
|
@chapter Metrics List
|
|
35398
35943
|
|