adlint 1.2.0 → 1.4.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/AUTHORS +1 -1
- data/ChangeLog +272 -0
- data/MANIFEST +4 -0
- data/NEWS +39 -4
- data/etc/mesg.d/en_US/messages.yml +2 -2
- data/etc/mesg.d/ja_JP/messages.yml +2 -2
- data/lib/adlint/c.rb +1 -0
- data/lib/adlint/c/expr.rb +20 -26
- data/lib/adlint/c/interp.rb +137 -45
- data/lib/adlint/c/mediator.rb +4 -0
- data/lib/adlint/c/message.rb +479 -16
- data/lib/adlint/c/message_shima.rb +151 -0
- data/lib/adlint/c/phase.rb +23 -0
- data/lib/adlint/c/resolver.rb +1 -0
- data/lib/adlint/c/syntax.rb +93 -89
- data/lib/adlint/c/type.rb +70 -0
- data/lib/adlint/cpp/eval.rb +12 -1
- data/lib/adlint/cpp/message_shima.rb +51 -0
- data/lib/adlint/cpp/phase.rb +3 -0
- data/lib/adlint/version.rb +2 -2
- data/share/demo/Makefile +3 -0
- data/share/demo/bad_enum/bad_enum.c +27 -0
- data/share/demo/bad_macro/bad_macro.c +4 -0
- data/share/demo/bad_return/bad_return.c +83 -0
- data/share/demo/incomplete_type/incomplete_type.c +3 -0
- data/share/demo/overflow/overflow.c +59 -5
- data/share/demo/union_type/union_type.c +13 -0
- data/share/demo/unnamed_member/unnamed_member.c +13 -0
- data/share/demo/various_fundef/various_fundef.c +43 -0
- data/share/demo/wrap_around/wrap_around.c +95 -21
- 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 +222 -149
- data/share/doc/users_guide_en.texi +194 -120
- data/share/doc/users_guide_ja.html +224 -167
- data/share/doc/users_guide_ja.texi +194 -137
- metadata +6 -2
data/AUTHORS
CHANGED
data/ChangeLog
CHANGED
@@ -1,3 +1,275 @@
|
|
1
|
+
Thu Mar 29 10:53:48 2012 Yutaka Yanoh <yanoh@users.sourceforge.net>
|
2
|
+
|
3
|
+
* release.ga : 1.4.0
|
4
|
+
- Add W0606 detection.
|
5
|
+
- Add W0687 detection.
|
6
|
+
- Add W0695 detection.
|
7
|
+
- Add W0698 detection.
|
8
|
+
- Add W0699 detection.
|
9
|
+
- Add W0720 detection.
|
10
|
+
- Add W0721 detection.
|
11
|
+
- Add W0722 detection.
|
12
|
+
- Add W0723 detection.
|
13
|
+
- Add W0726 detection.
|
14
|
+
- Add W0727 detection.
|
15
|
+
- Add W0728 detection.
|
16
|
+
- Add W0729 detection.
|
17
|
+
- Add W0730 detection.
|
18
|
+
- Add W0731 detection.
|
19
|
+
- Add W0737 detection.
|
20
|
+
- Add W0738 detection.
|
21
|
+
- Add W0739 detection.
|
22
|
+
- Add W0740 detection.
|
23
|
+
- Add W0741 detection.
|
24
|
+
- Add W0743 detection.
|
25
|
+
- Add W0801 detection.
|
26
|
+
- Add W0806 detection.
|
27
|
+
- Add W1033 detection.
|
28
|
+
- Add W1064 detection.
|
29
|
+
- Add W1065 detection.
|
30
|
+
- Add missing implicit conversion of return-statement in order to
|
31
|
+
detect W0727 at an expression of return-statement.
|
32
|
+
- Update the user's guide in Japanese.
|
33
|
+
- Update the user's guide in English.
|
34
|
+
|
35
|
+
Wed Mar 28 15:30:55 2012 Yutaka Yanoh <yanoh@users.sourceforge.net>
|
36
|
+
|
37
|
+
* release.beta : 1.3.3
|
38
|
+
- Fix interpreter in order to detect W0653 correctly.
|
39
|
+
|
40
|
+
Wed Mar 28 15:24:20 2012 Yutaka Yanoh <yanoh@users.sourceforge.net>
|
41
|
+
|
42
|
+
* lib/adlint/c/interp.rb : Fix evaluation of a string literal as an
|
43
|
+
initializer of the array variable definition in order to detect
|
44
|
+
W0653 correctly.
|
45
|
+
|
46
|
+
Wed Mar 28 13:51:55 2012 Yutaka Yanoh <yanoh@users.sourceforge.net>
|
47
|
+
|
48
|
+
* release.beta : 1.3.2
|
49
|
+
- Fix interpreter in order to detect W0255 family, W0459, W0580,
|
50
|
+
W0653, W0654 and W0730 correctly.
|
51
|
+
- Update the user's guide in Japanese.
|
52
|
+
- Update the user's guide in English.
|
53
|
+
|
54
|
+
Wed Mar 28 13:48:16 2012 Yutaka Yanoh <yanoh@users.sourceforge.net>
|
55
|
+
|
56
|
+
* lib/adlint/c/interp.rb : Fix initialization of the array variable
|
57
|
+
defined with a string literal as an initializer in order to detect
|
58
|
+
W0580 correctly.
|
59
|
+
|
60
|
+
Wed Mar 28 13:39:56 2012 Yutaka Yanoh <yanoh@users.sourceforge.net>
|
61
|
+
|
62
|
+
* lib/adlint/c/interp.rb : Fix notification of variable initialization
|
63
|
+
to pass the original object of an implicit conversion in order to
|
64
|
+
detect W0653 and W0654 correctly.
|
65
|
+
|
66
|
+
Wed Mar 28 12:04:08 2012 Yutaka Yanoh <yanoh@users.sourceforge.net>
|
67
|
+
|
68
|
+
* lib/adlint/c/interp.rb : Fix notification of return-statement
|
69
|
+
evaluation not to confuse W0255 family and W0730 detections.
|
70
|
+
|
71
|
+
Wed Mar 28 11:39:43 2012 Yutaka Yanoh <yanoh@users.sourceforge.net>
|
72
|
+
|
73
|
+
* lib/adlint/c/expr.rb : Fix access notification of array or composite
|
74
|
+
typeed variable value and add missing reference notification of the
|
75
|
+
array value in evaluation of an array-subscript-expression in order
|
76
|
+
to detect W0459 correctly.
|
77
|
+
|
78
|
+
Wed Mar 28 09:58:58 2012 Yutaka Yanoh <yanoh@users.sourceforge.net>
|
79
|
+
|
80
|
+
* share/doc/users_guide_ja.texi : Update descriptions about added
|
81
|
+
warning messages.
|
82
|
+
* share/doc/users_guide_en.texi : Ditto.
|
83
|
+
|
84
|
+
Tue Mar 27 17:59:37 2012 Yutaka Yanoh <yanoh@users.sourceforge.net>
|
85
|
+
|
86
|
+
* release.beta : 1.3.1
|
87
|
+
- Add W0737 detection.
|
88
|
+
- Add W0738 detection.
|
89
|
+
- Add W0739 detection.
|
90
|
+
- Add W0740 detection.
|
91
|
+
- Add W0741 detection.
|
92
|
+
- Add W0743 detection.
|
93
|
+
- Add missing implicit conversion of return-statement in order to
|
94
|
+
detect W0727 at an expression of return-statement.
|
95
|
+
- Update the user's guide in Japanese.
|
96
|
+
- Update the user's guide in English.
|
97
|
+
|
98
|
+
Tue Mar 27 17:51:06 2012 Yutaka Yanoh <yanoh@users.sourceforge.net>
|
99
|
+
|
100
|
+
* lib/adlint/c/message.rb : Add W0743 detection.
|
101
|
+
* lib/adlint/c/phase.rb : Ditto.
|
102
|
+
* share/demo/overflow/overflow.c : Add sample code.
|
103
|
+
|
104
|
+
Tue Mar 27 17:34:14 2012 Yutaka Yanoh <yanoh@users.sourceforge.net>
|
105
|
+
|
106
|
+
* lib/adlint/c/message.rb : Add W0740 and W0741 detections.
|
107
|
+
* lib/adlint/c/phase.rb : Ditto.
|
108
|
+
* share/demo/wrap_around/wrap_around.c : Add sample code.
|
109
|
+
|
110
|
+
Tue Mar 27 17:14:34 2012 Yutaka Yanoh <yanoh@users.sourceforge.net>
|
111
|
+
|
112
|
+
* lib/adlint/c/message.rb : Add W0739 detection.
|
113
|
+
* lib/adlint/c/phase.rb : Ditto.
|
114
|
+
* share/demo/wrap_around/wrap_around.c : Add sample code.
|
115
|
+
|
116
|
+
Tue Mar 27 16:20:13 2012 Yutaka Yanoh <yanoh@users.sourceforge.net>
|
117
|
+
|
118
|
+
* lib/adlint/c/message.rb : Add W0738 detection.
|
119
|
+
* lib/adlint/c/phase.rb : Ditto.
|
120
|
+
* share/demo/overflow/overflow.c : Add sample code.
|
121
|
+
|
122
|
+
Tue Mar 27 16:18:14 2012 Yutaka Yanoh <yanoh@users.sourceforge.net>
|
123
|
+
|
124
|
+
* lib/adlint/c/interp.rb : Move responsibility of implicit conversion
|
125
|
+
in evaluation of a variable-definition with initializers to
|
126
|
+
InitializerInterpreter in order to detect implicit conversions at
|
127
|
+
expressions in initializers.
|
128
|
+
|
129
|
+
Tue Mar 27 15:02:45 2012 Yutaka Yanoh <yanoh@users.sourceforge.net>
|
130
|
+
|
131
|
+
* lib/adlint/c/message.rb : Add W0737 detection.
|
132
|
+
* lib/adlint/c/phase.rb : Ditto.
|
133
|
+
* share/demo/incomplete_type/incomplete_type.c : Add sample code.
|
134
|
+
|
135
|
+
Tue Mar 27 12:05:03 2012 Yutaka Yanoh <yanoh@users.sourceforge.net>
|
136
|
+
|
137
|
+
* lib/adlint/c/interp.rb : Add missing conversion logic of
|
138
|
+
return-statement evaluation.
|
139
|
+
* share/demo/bad_enum/bad_enum.c : Add sample code.
|
140
|
+
|
141
|
+
Mon Mar 26 17:05:05 2012 Yutaka Yanoh <yanoh@users.sourceforge.net>
|
142
|
+
|
143
|
+
* release.beta : 1.3.0
|
144
|
+
- This is the initial beta release for 1.4.0 GA release.
|
145
|
+
- Add W0606 detection.
|
146
|
+
- Add W0687 detection.
|
147
|
+
- Add W0695 detection.
|
148
|
+
- Add W0698 detection.
|
149
|
+
- Add W0699 detection.
|
150
|
+
- Add W0720 detection.
|
151
|
+
- Add W0721 detection.
|
152
|
+
- Add W0722 detection.
|
153
|
+
- Add W0723 detection.
|
154
|
+
- Add W0726 detection.
|
155
|
+
- Add W0727 detection.
|
156
|
+
- Add W0728 detection.
|
157
|
+
- Add W0729 detection.
|
158
|
+
- Add W0730 detection.
|
159
|
+
- Add W0731 detection.
|
160
|
+
- Add W0801 detection.
|
161
|
+
- Add W0806 detection.
|
162
|
+
- Add W1033 detection.
|
163
|
+
- Add W1064 detection.
|
164
|
+
- Add W1065 detection.
|
165
|
+
- Update the user's guide in Japanese.
|
166
|
+
- Update the user's guide in English.
|
167
|
+
|
168
|
+
Mon Mar 26 16:50:45 2012 Rie Shima <rkakuuchi@users.sourceforge.net>
|
169
|
+
|
170
|
+
* share/doc/users_guide_ja.texi : Update descriptions about added
|
171
|
+
warning messages.
|
172
|
+
* share/doc/users_guide_en.texi : Ditto.
|
173
|
+
|
174
|
+
Mon Mar 26 16:13:26 2012 Yutaka Yanoh <yanoh@users.sourceforge.net>
|
175
|
+
|
176
|
+
* lib/adlint/c/message.rb : Add W0731, W1064 and W1065 detections.
|
177
|
+
* lib/adlint/c/phase.rb : Ditto.
|
178
|
+
* share/demo/bad_enum/bad_enum.c : Add sample code.
|
179
|
+
* lib/adlint/c/interp.rb : Add notifications about switch-statement.
|
180
|
+
* lib/adlint/c/mediator.rb : Ditto.
|
181
|
+
|
182
|
+
Mon Mar 26 12:23:10 2012 Yutaka Yanoh <yanoh@users.sourceforge.net>
|
183
|
+
|
184
|
+
* lib/adlint/c/message.rb : Add W0727, W0728, W0729 and W0730
|
185
|
+
detections.
|
186
|
+
* lib/adlint/c/phase.rb : Ditto.
|
187
|
+
* lib/adlint/c/expr.rb : Ditto.
|
188
|
+
* lib/adlint/c/type.rb : Ditto.
|
189
|
+
* share/demo/Makefile : Add `bad_enum' demo.
|
190
|
+
* share/demo/bad_enum/bad_enum.c : Ditto.
|
191
|
+
|
192
|
+
Mon Mar 26 12:19:13 2012 Yutaka Yanoh <yanoh@users.sourceforge.net>
|
193
|
+
|
194
|
+
* lib/adlint/c/resolver.rb : Add type attribute to enumerators.
|
195
|
+
* lib/adlint/c/syntax.rb : Ditto.
|
196
|
+
|
197
|
+
Mon Mar 26 10:14:06 2012 Yutaka Yanoh <yanoh@users.sourceforge.net>
|
198
|
+
|
199
|
+
* lib/adlint/c/message.rb : Add W0722 and W0723 detections.
|
200
|
+
* lib/adlint/c/phase.rb : Ditto.
|
201
|
+
* share/demo/wrap_around/wrap_around.c : Add sample code.
|
202
|
+
|
203
|
+
Fri Mar 23 21:24:08 2012 Yutaka Yanoh <yanoh@users.sourceforge.net>
|
204
|
+
|
205
|
+
* lib/adlint/c/message.rb : Add W0721 detection.
|
206
|
+
* lib/adlint/c/phase.rb : Ditto.
|
207
|
+
* share/demo/overflow/overflow.c : Add sample code.
|
208
|
+
|
209
|
+
Fri Mar 23 20:11:29 2012 Rie Shima <rkakuuchi@users.sourceforge.net>
|
210
|
+
|
211
|
+
* lib/adlint/cpp/message_shima.rb : Add W0687, W0695 and W0806
|
212
|
+
detections.
|
213
|
+
* lib/adlint/cpp/phase.rb : Ditto.
|
214
|
+
* share/demo/bad_macro/bad_macro.c : Add sample code.
|
215
|
+
|
216
|
+
Fri Mar 23 20:08:37 2012 Yutaka Yanoh <yanoh@users.sourceforge.net>
|
217
|
+
|
218
|
+
* lib/adlint/cpp/eval.rb : Add #undef notification.
|
219
|
+
|
220
|
+
Fri Mar 23 19:00:17 2012 Yutaka Yanoh <yanoh@users.sourceforge.net>
|
221
|
+
|
222
|
+
* etc/mesg.d/ja_JP/messages.yml : Refine message text of W0726.
|
223
|
+
* etc/mesg.d/en_US/messages.yml : Ditto.
|
224
|
+
* share/doc/users_guide_ja.texi : Ditto.
|
225
|
+
* share/doc/users_guide_en.texi : Ditto.
|
226
|
+
|
227
|
+
Fri Mar 23 18:55:29 2012 Yutaka Yanoh <yanoh@users.sourceforge.net>
|
228
|
+
|
229
|
+
* lib/adlint/c/syntax.rb : Refactor using Enumerable#each_with_object.
|
230
|
+
|
231
|
+
Fri Mar 23 18:44:30 2012 Rie Shima <rkakuuchi@users.sourceforge.net>
|
232
|
+
|
233
|
+
* lib/adlint/c/message_shima.rb : Add W0606, W0698, W0699, W0726, W0801
|
234
|
+
and W1033 detections.
|
235
|
+
* lib/adlint/c/phase.rb : Ditto.
|
236
|
+
* lib/adlint/c.rb : Ditto.
|
237
|
+
* MANIFEST : Ditto.
|
238
|
+
* share/demo/Makefile : Add `bad_return' and `unnamed_member' demos.
|
239
|
+
* share/demo/bad_return/bad_return.c : Ditto.
|
240
|
+
* share/demo/unnamed_member/unnamed_member.c : Ditto.
|
241
|
+
* share/demo/union_type/union_type.c : Add sample code.
|
242
|
+
* share/demo/various_fundef/various_fundef.c : Ditto.
|
243
|
+
|
244
|
+
Fri Mar 23 16:39:13 2012 Yutaka Yanoh <yanoh@users.sourceforge.net>
|
245
|
+
|
246
|
+
* lib/adlint/c/message.rb : Add W0720 detection.
|
247
|
+
* lib/adlint/c/phase.rb : Ditto.
|
248
|
+
* share/demo/overflow/overflow.c : Ditto.
|
249
|
+
|
250
|
+
Fri Mar 23 14:11:20 2012 Yutaka Yanoh <yanoh@users.sourceforge.net>
|
251
|
+
|
252
|
+
* lib/adlint/c/message.rb : Modify W0457 and W0458 detections to use
|
253
|
+
new #implicitly_typed? method to check whether a definition or
|
254
|
+
declaration is typed implicitly.
|
255
|
+
* lib/adlint/c/syntax.rb : Fix inverted check logic.
|
256
|
+
|
257
|
+
Fri Mar 23 13:39:12 2012 Yutaka Yanoh <yanoh@users.sourceforge.net>
|
258
|
+
|
259
|
+
* lib/adlint/c/syntax.rb : Add DeclarationSpecifiersHolder module to
|
260
|
+
commonalize accessors of DeclarationSpecifiers.
|
261
|
+
|
262
|
+
Fri Mar 23 12:07:52 2012 Yutaka Yanoh <yanoh@users.sourceforge.net>
|
263
|
+
|
264
|
+
* lib/adlint/c/syntax.rb : Add DeclarationSpecifiers#explicitly_typed?
|
265
|
+
and DeclarationSpecifiers#implicitly_typed? methods.
|
266
|
+
|
267
|
+
Fri Mar 23 12:03:14 2012 Yutaka Yanoh <yanoh@users.sourceforge.net>
|
268
|
+
|
269
|
+
* lib/adlint/c/syntax.rb : Move common responsibilities of
|
270
|
+
VariableDefinition, FunctionDefinition and ParameterDefinition to
|
271
|
+
Definition class.
|
272
|
+
|
1
273
|
Wed Mar 21 18:50:39 2012 Yutaka Yanoh <yanoh@users.sourceforge.net>
|
2
274
|
|
3
275
|
* release.ga : 1.2.0
|
data/MANIFEST
CHANGED
@@ -45,6 +45,7 @@ lib/adlint/c/interp.rb
|
|
45
45
|
lib/adlint/c/lexer.rb
|
46
46
|
lib/adlint/c/mediator.rb
|
47
47
|
lib/adlint/c/message.rb
|
48
|
+
lib/adlint/c/message_shima.rb
|
48
49
|
lib/adlint/c/metric.rb
|
49
50
|
lib/adlint/c/object.rb
|
50
51
|
lib/adlint/c/parser.y
|
@@ -109,10 +110,12 @@ share/demo/bad_charset/bad_charset.c
|
|
109
110
|
share/demo/bad_comment/bad_comment.c
|
110
111
|
share/demo/bad_const/bad_const.c
|
111
112
|
share/demo/bad_conv/bad_conv.c
|
113
|
+
share/demo/bad_enum/bad_enum.c
|
112
114
|
share/demo/bad_indent/bad_indent.c
|
113
115
|
share/demo/bad_init/bad_init.c
|
114
116
|
share/demo/bad_line/bad_line.c
|
115
117
|
share/demo/bad_macro/bad_macro.c
|
118
|
+
share/demo/bad_return/bad_return.c
|
116
119
|
share/demo/bitwise_expr/bitwise_expr.c
|
117
120
|
share/demo/call_by_value/call_by_value.c
|
118
121
|
share/demo/cross_ref/cross_ref.c
|
@@ -194,6 +197,7 @@ share/demo/unmatch_decl/unmatch_decl_2.c
|
|
194
197
|
share/demo/unmatch_decl/unmatch_decl_2.h
|
195
198
|
share/demo/unmatch_decl/unmatch_decl_3.c
|
196
199
|
share/demo/unmatch_paren_macro/unmatch_paren_macro.c
|
200
|
+
share/demo/unnamed_member/unnamed_member.c
|
197
201
|
share/demo/unreachable/unreachable.c
|
198
202
|
share/demo/useless_exp_funs/useless_exp_funs_1.c
|
199
203
|
share/demo/useless_exp_funs/useless_exp_funs_1.h
|
data/NEWS
CHANGED
@@ -21,6 +21,45 @@
|
|
21
21
|
|
22
22
|
++
|
23
23
|
|
24
|
+
=== \AdLint 1.4.0 is released (2012-03-29)
|
25
|
+
|
26
|
+
==== Changes since the 1.2.0 release
|
27
|
+
|
28
|
+
* Add W0606 detection
|
29
|
+
* Add W0687 detection
|
30
|
+
* Add W0695 detection
|
31
|
+
* Add W0698 detection
|
32
|
+
* Add W0699 detection
|
33
|
+
* Add W0720 detection
|
34
|
+
* Add W0721 detection
|
35
|
+
* Add W0722 detection
|
36
|
+
* Add W0723 detection
|
37
|
+
* Add W0726 detection
|
38
|
+
* Add W0727 detection
|
39
|
+
* Add W0728 detection
|
40
|
+
* Add W0729 detection
|
41
|
+
* Add W0730 detection
|
42
|
+
* Add W0731 detection
|
43
|
+
* Add W0737 detection
|
44
|
+
* Add W0738 detection
|
45
|
+
* Add W0739 detection
|
46
|
+
* Add W0740 detection
|
47
|
+
* Add W0741 detection
|
48
|
+
* Add W0743 detection
|
49
|
+
* Add W0801 detection
|
50
|
+
* Add W0806 detection
|
51
|
+
* Add W1033 detection
|
52
|
+
* Add W1064 detection
|
53
|
+
* Add W1065 detection
|
54
|
+
* Add missing implicit conversion of return-statement in order to detect W0727
|
55
|
+
at an expression of return-statement
|
56
|
+
* Update the user's guide in Japanese
|
57
|
+
* Update the user's guide in English
|
58
|
+
|
59
|
+
See the file
|
60
|
+
{ChangeLog}[http://adlint.sourceforge.net/pmwiki/upload.d/Main/ChangeLog]
|
61
|
+
for more details.
|
62
|
+
|
24
63
|
=== \AdLint 1.2.0 is released (2012-03-21)
|
25
64
|
|
26
65
|
==== Changes since the 1.0.0 release
|
@@ -40,10 +79,6 @@
|
|
40
79
|
* Update the user's guide in Japanese
|
41
80
|
* Update the user's guide in English
|
42
81
|
|
43
|
-
See the file
|
44
|
-
{ChangeLog}[http://adlint.sourceforge.net/pmwiki/upload.d/Main/ChangeLog]
|
45
|
-
for more details.
|
46
|
-
|
47
82
|
=== \AdLint 1.0.0 is released (2012-02-28)
|
48
83
|
|
49
84
|
This is the initial GA release of \AdLint.
|
@@ -36,7 +36,7 @@
|
|
36
36
|
# X9999: "Your custom message for the fatal error of #9999."
|
37
37
|
# E9999: "Your custom message for the error of #9999."
|
38
38
|
|
39
|
-
version: "1.
|
39
|
+
version: "1.4.0"
|
40
40
|
|
41
41
|
message_definition:
|
42
42
|
X0001: "An unknown exception `%s' is found."
|
@@ -646,7 +646,7 @@ message_definition:
|
|
646
646
|
W0722: "A value of signed statement is overflow."
|
647
647
|
W0723: "A value of signed statement might be overflow."
|
648
648
|
W0724: "An unrecognized preprocessing directive is ignored by conditional include directive."
|
649
|
-
W0726: "A function `%s()' which return value is declared as qualified void type
|
649
|
+
W0726: "A function `%s()' which return value is declared as qualified void type, `return expression;' is found."
|
650
650
|
W0727: "The value not part of the enumeration type is used."
|
651
651
|
W0728: "Other enumeration literal of enumeration type is passed to enumeration literal of formal argument as actual argument."
|
652
652
|
W0729: "An enumeration literal of the other enumeration type is substituted for enumeration type object."
|
@@ -36,7 +36,7 @@
|
|
36
36
|
# X9999: "Your custom message for the fatal error of #9999."
|
37
37
|
# E9999: "Your custom message for the error of #9999."
|
38
38
|
|
39
|
-
version: "1.
|
39
|
+
version: "1.4.0"
|
40
40
|
|
41
41
|
message_definition:
|
42
42
|
X0001: "不明な例外条件 `%s' を検出しました。"
|
@@ -646,7 +646,7 @@ message_definition:
|
|
646
646
|
W0722: "符号付きの式の値がオーバーフローしています。"
|
647
647
|
W0723: "符号付きの式の値がオーバーフローする可能性があります。"
|
648
648
|
W0724: "条件付きインクルード指令によって、認識できない前処理指令が無視されました。"
|
649
|
-
W0726: "修飾子付き void 型の戻り値が定義された関数 `%s()' の中で、`return
|
649
|
+
W0726: "修飾子付き void 型の戻り値が定義された関数 `%s()' の中で、`return 式;' が見つかりました。"
|
650
650
|
W0727: "列挙型にない値を使っています。"
|
651
651
|
W0728: "列挙型の関数仮引数に、別の列挙型の列挙定数が実引数として渡されています。"
|
652
652
|
W0729: "列挙型のオブジェクトに、別の列挙型の列挙定数が代入されています。"
|
data/lib/adlint/c.rb
CHANGED
data/lib/adlint/c/expr.rb
CHANGED
@@ -68,7 +68,7 @@ module C #:nodoc:
|
|
68
68
|
|
69
69
|
if enumerator = enumerator_named(node.identifier.value)
|
70
70
|
enumerator.mark_as_referred_by(node.identifier)
|
71
|
-
return temporary_variable(
|
71
|
+
return temporary_variable(enumerator.type, ScalarValue.of(enumerator.value))
|
72
72
|
end
|
73
73
|
|
74
74
|
define_implicit_function(node.identifier.value)
|
@@ -96,10 +96,9 @@ module C #:nodoc:
|
|
96
96
|
when array_or_pointer.type.array?
|
97
97
|
array = array_or_pointer
|
98
98
|
when array_or_pointer.type.pointer?
|
99
|
-
if pointee = pointee_of(array_or_pointer)
|
100
|
-
|
101
|
-
|
102
|
-
end
|
99
|
+
if pointee = pointee_of(array_or_pointer) and pointee.type.array?
|
100
|
+
array = pointee
|
101
|
+
_notify_variable_value_referred(node, array)
|
103
102
|
end
|
104
103
|
end
|
105
104
|
|
@@ -848,14 +847,14 @@ module C #:nodoc:
|
|
848
847
|
rhs_object, rhs_variable)
|
849
848
|
end
|
850
849
|
|
851
|
-
if lhs_variable.type.same_as?(
|
852
|
-
rhs_converted =
|
850
|
+
if lhs_variable.type.same_as?(rhs_variable.type)
|
851
|
+
rhs_converted = rhs_variable
|
853
852
|
else
|
854
853
|
rhs_converted =
|
855
|
-
do_conversion(
|
854
|
+
do_conversion(rhs_variable, lhs_variable.type) ||
|
856
855
|
temporary_variable(lhs_variable.type)
|
857
856
|
notify_implicit_conv_performed(node.rhs_operand,
|
858
|
-
|
857
|
+
rhs_variable, rhs_converted)
|
859
858
|
end
|
860
859
|
|
861
860
|
# NOTE: Domain of the arithmetic result value will be restricted by
|
@@ -867,7 +866,7 @@ module C #:nodoc:
|
|
867
866
|
_notify_variable_value_referred(node, rhs_variable)
|
868
867
|
_notify_variable_value_updated(node, lhs_variable)
|
869
868
|
|
870
|
-
notify_assignment_expr_evaled(node, lhs_variable,
|
869
|
+
notify_assignment_expr_evaled(node, lhs_variable, rhs_variable)
|
871
870
|
|
872
871
|
lhs_variable
|
873
872
|
end
|
@@ -1452,32 +1451,27 @@ module C #:nodoc:
|
|
1452
1451
|
module_function :_notify_object_referred
|
1453
1452
|
|
1454
1453
|
def _notify_variable_value_referred(node, object)
|
1455
|
-
if object.kind_of?(InnerVariable)
|
1456
|
-
# NOTE: When a value of the inner-variable of array or composite object
|
1457
|
-
# is referred, the outmost variable's value is notified to be
|
1458
|
-
# referred.
|
1459
|
-
object = object.owner
|
1460
|
-
object = object.owner while object.kind_of?(InnerVariable)
|
1461
|
-
end
|
1462
|
-
|
1463
1454
|
if object.variable?
|
1464
1455
|
interpreter.notify_variable_value_referred(node, object)
|
1465
1456
|
end
|
1457
|
+
|
1458
|
+
# NOTE: When a value of the inner-variable of array or composite object
|
1459
|
+
# is referred, notification of the outer variable's value has
|
1460
|
+
# already been done in sub expressions.
|
1466
1461
|
end
|
1467
1462
|
module_function :_notify_variable_value_referred
|
1468
1463
|
|
1469
1464
|
def _notify_variable_value_updated(node, object)
|
1470
|
-
if object.kind_of?(InnerVariable)
|
1471
|
-
# NOTE: When a value of the inner-variable of array or composite object
|
1472
|
-
# is updated, the outmost variable's value is notified to be
|
1473
|
-
# updated.
|
1474
|
-
object = object.owner
|
1475
|
-
object = object.owner while object.kind_of?(InnerVariable)
|
1476
|
-
end
|
1477
|
-
|
1478
1465
|
if object.variable?
|
1479
1466
|
interpreter.notify_variable_value_updated(node, object)
|
1480
1467
|
end
|
1468
|
+
|
1469
|
+
if object.kind_of?(InnerVariable)
|
1470
|
+
# NOTE: When a value of the inner-variable of array or composite object
|
1471
|
+
# is updated, the outer variable's value should also be notified
|
1472
|
+
# to be updated.
|
1473
|
+
_notify_variable_value_updated(node, object.owner)
|
1474
|
+
end
|
1481
1475
|
end
|
1482
1476
|
module_function :_notify_variable_value_updated
|
1483
1477
|
|