adlint 3.0.8 → 3.0.10
Sign up to get free protection for your applications and to get access to all the features.
- data/ChangeLog +295 -0
- data/MANIFEST +9 -0
- data/NEWS +25 -4
- data/etc/mesg.d/c_builtin/en_US/messages.yml +1 -1
- data/etc/mesg.d/c_builtin/ja_JP/messages.yml +1 -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/E0008.feature +20 -0
- data/features/code_check/W0093.feature +1 -1
- data/features/code_check/W0097.feature +30 -0
- data/features/code_check/W0100.feature +66 -0
- data/features/code_check/W0422.feature +157 -0
- data/features/code_check/W0459.feature +118 -0
- data/features/code_check/W0461.feature +115 -0
- data/features/code_check/W0610.feature +59 -0
- data/features/code_check/W0612.feature +29 -0
- data/features/code_check/W0613.feature +33 -0
- data/features/code_check/W0704.feature +25 -0
- data/features/code_check/W0705.feature +33 -0
- data/features/code_check/W1050.feature +43 -0
- data/features/code_check/W1071.feature +30 -0
- data/features/code_check/W9001.feature +24 -0
- data/lib/adlint/cc1/branch.rb +32 -9
- data/lib/adlint/cc1/builtin.rb +2 -2
- data/lib/adlint/cc1/conv.rb +33 -33
- data/lib/adlint/cc1/ctrlexpr.rb +30 -30
- data/lib/adlint/cc1/domain.rb +12 -4
- data/lib/adlint/cc1/environ.rb +2 -1
- data/lib/adlint/cc1/expr.rb +135 -125
- data/lib/adlint/cc1/format.rb +3 -3
- data/lib/adlint/cc1/interp.rb +123 -109
- data/lib/adlint/cc1/lexer.rb +44 -40
- data/lib/adlint/cc1/mediator.rb +2 -2
- data/lib/adlint/cc1/object.rb +121 -36
- data/lib/adlint/cc1/option.rb +1 -0
- data/lib/adlint/cc1/parser.rb +874 -845
- data/lib/adlint/cc1/parser.y +22 -2
- data/lib/adlint/cc1/syntax.rb +37 -18
- data/lib/adlint/cc1/type.rb +3 -3
- data/lib/adlint/cc1/value.rb +58 -50
- data/lib/adlint/cpp/lexer.rb +5 -1
- data/lib/adlint/cpp/macro.rb +30 -30
- data/lib/adlint/cpp/subst.rb +4 -4
- data/lib/adlint/exam/c_builtin/cc1_check.rb +172 -172
- data/lib/adlint/exam/c_builtin/cc1_check_shima.rb +11 -11
- data/lib/adlint/exam/c_builtin/cpp_check.rb +2 -2
- data/lib/adlint/memo.rb +13 -13
- data/lib/adlint/prelude.rb +2 -2
- data/lib/adlint/version.rb +2 -2
- data/share/doc/developers_guide_ja.html +7 -5
- data/share/doc/developers_guide_ja.texi +5 -3
- data/share/doc/users_guide_en.html +3 -3
- data/share/doc/users_guide_en.texi +1 -1
- data/share/doc/users_guide_ja.html +3 -3
- data/share/doc/users_guide_ja.texi +1 -1
- metadata +11 -2
@@ -797,13 +797,13 @@ module CBuiltin #:nodoc:
|
|
797
797
|
end
|
798
798
|
|
799
799
|
private
|
800
|
-
def check(*,
|
801
|
-
|
802
|
-
|
803
|
-
|
804
|
-
|
805
|
-
|
806
|
-
|
800
|
+
def check(*, orig_var, rslt_var)
|
801
|
+
return unless @rvalues && orig_var.type.floating?
|
802
|
+
|
803
|
+
case expr = @rvalues[orig_var]
|
804
|
+
when Cc1::AdditiveExpression, Cc1::MultiplicativeExpression
|
805
|
+
if orig_var.type.same_as?(from_type) && rslt_var.type.same_as?(to_type)
|
806
|
+
W(expr.location)
|
807
807
|
end
|
808
808
|
end
|
809
809
|
end
|
@@ -812,13 +812,13 @@ module CBuiltin #:nodoc:
|
|
812
812
|
@rvalues = {}
|
813
813
|
end
|
814
814
|
|
815
|
-
def handle_additive(expr, *,
|
816
|
-
memorize_rvalue_derivation(
|
815
|
+
def handle_additive(expr, *, rslt_var)
|
816
|
+
memorize_rvalue_derivation(rslt_var, expr)
|
817
817
|
end
|
818
818
|
|
819
|
-
def handle_multiplicative(expr, *,
|
819
|
+
def handle_multiplicative(expr, *, rslt_var)
|
820
820
|
unless expr.operator.type == "%"
|
821
|
-
memorize_rvalue_derivation(
|
821
|
+
memorize_rvalue_derivation(rslt_var, expr)
|
822
822
|
end
|
823
823
|
end
|
824
824
|
|
@@ -1253,8 +1253,8 @@ module CBuiltin #:nodoc:
|
|
1253
1253
|
end
|
1254
1254
|
|
1255
1255
|
private
|
1256
|
-
def check(*,
|
1257
|
-
if defined_tok =
|
1256
|
+
def check(*, rslt_toks)
|
1257
|
+
if defined_tok = rslt_toks.find { |tok| tok.value == "defined" }
|
1258
1258
|
W(defined_tok.location)
|
1259
1259
|
end
|
1260
1260
|
end
|
data/lib/adlint/memo.rb
CHANGED
@@ -61,10 +61,10 @@ module AdLint #:nodoc:
|
|
61
61
|
else
|
62
62
|
if #{cache_name_of(name)}_forbidden ||= false
|
63
63
|
#{cache_name_of(name)}_forbidden = false
|
64
|
-
#{
|
64
|
+
#{orig_name_of(name)}
|
65
65
|
else
|
66
66
|
#{cache_name_of(name)}_initialized = true
|
67
|
-
#{cache_name_of(name)} = #{
|
67
|
+
#{cache_name_of(name)} = #{orig_name_of(name)}(*args)
|
68
68
|
end
|
69
69
|
end
|
70
70
|
end
|
@@ -82,16 +82,16 @@ module AdLint #:nodoc:
|
|
82
82
|
if #{cache_name_of(name)}.include?(key)
|
83
83
|
#{cache_name_of(name)}[key]
|
84
84
|
else
|
85
|
-
#{cache_name_of(name)}[key] = #{
|
85
|
+
#{cache_name_of(name)}[key] = #{orig_name_of(name)}(*args)
|
86
86
|
end
|
87
87
|
else
|
88
88
|
if #{cache_name_of(name)}_forbidden ||= false
|
89
89
|
#{cache_name_of(name)}_forbidden = false
|
90
|
-
#{
|
90
|
+
#{orig_name_of(name)}(*args)
|
91
91
|
else
|
92
92
|
#{cache_name_of(name)}_initialized = true
|
93
93
|
#{cache_name_of(name)} = {}
|
94
|
-
#{cache_name_of(name)}[key] = #{
|
94
|
+
#{cache_name_of(name)}[key] = #{orig_name_of(name)}(*args)
|
95
95
|
end
|
96
96
|
end
|
97
97
|
end
|
@@ -109,16 +109,16 @@ module AdLint #:nodoc:
|
|
109
109
|
if #{cache_name_of(name)}.include?(key)
|
110
110
|
#{cache_name_of(name)}[key]
|
111
111
|
else
|
112
|
-
#{cache_name_of(name)}[key] = #{
|
112
|
+
#{cache_name_of(name)}[key] = #{orig_name_of(name)}(*args)
|
113
113
|
end
|
114
114
|
else
|
115
115
|
if #{cache_name_of(name)}_forbidden ||= false
|
116
116
|
#{cache_name_of(name)}_forbidden = false
|
117
|
-
#{
|
117
|
+
#{orig_name_of(name)}(*args)
|
118
118
|
else
|
119
119
|
#{cache_name_of(name)}_initialized = true
|
120
120
|
#{cache_name_of(name)} = {}
|
121
|
-
#{cache_name_of(name)}[key] = #{
|
121
|
+
#{cache_name_of(name)}[key] = #{orig_name_of(name)}(*args)
|
122
122
|
end
|
123
123
|
end
|
124
124
|
end
|
@@ -194,17 +194,17 @@ module AdLint #:nodoc:
|
|
194
194
|
|
195
195
|
def save_memoizing_method(name)
|
196
196
|
class_eval <<-EOS
|
197
|
-
alias_method(:#{
|
198
|
-
private(:#{
|
197
|
+
alias_method(:#{orig_name_of(name)}, :#{name})
|
198
|
+
private(:#{orig_name_of(name)})
|
199
199
|
EOS
|
200
200
|
end
|
201
201
|
|
202
202
|
def cache_name_of(name)
|
203
|
-
"@__cache_of__#{name.to_s.sub("?", "
|
203
|
+
"@__cache_of__#{name.to_s.sub("?", "_p")}"
|
204
204
|
end
|
205
205
|
|
206
|
-
def
|
207
|
-
"
|
206
|
+
def orig_name_of(name)
|
207
|
+
"__orig_#{name}"
|
208
208
|
end
|
209
209
|
end
|
210
210
|
|
data/lib/adlint/prelude.rb
CHANGED
@@ -327,9 +327,9 @@ end
|
|
327
327
|
# string_item: "foo${VAR}baz"
|
328
328
|
#
|
329
329
|
class Psych::TreeBuilder < Psych::Handler
|
330
|
-
alias :
|
330
|
+
alias :_orig_scalar :scalar
|
331
331
|
def scalar(value, anchor, tag, plain, quoted, style)
|
332
|
-
|
332
|
+
_orig_scalar(substitute_environment_variables(value),
|
333
333
|
anchor, tag, plain, quoted, style)
|
334
334
|
end
|
335
335
|
|
data/lib/adlint/version.rb
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
<html lang="ja">
|
2
2
|
<head>
|
3
|
-
<title>AdLint 3.0.
|
3
|
+
<title>AdLint 3.0.10 開発者ガイド</title>
|
4
4
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
5
|
-
<meta name="description" content="AdLint 3.0.
|
5
|
+
<meta name="description" content="AdLint 3.0.10 開発者ガイド">
|
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 3.0.
|
47
|
+
<h1 class="settitle">AdLint 3.0.10 開発者ガイド</h1>
|
48
48
|
<div class="contents">
|
49
49
|
<h2>Table of Contents</h2>
|
50
50
|
<ul>
|
@@ -169,7 +169,7 @@ definition -> def
|
|
169
169
|
enumerator -> enum
|
170
170
|
member -> memb
|
171
171
|
element -> elem
|
172
|
-
original ->
|
172
|
+
original -> orig
|
173
173
|
converted -> conved
|
174
174
|
conversion -> conv
|
175
175
|
arithmetic -> arith
|
@@ -275,7 +275,7 @@ logical-or -> lor
|
|
275
275
|
relationship -> relat
|
276
276
|
prototype -> proto
|
277
277
|
termination -> term
|
278
|
-
result ->
|
278
|
+
result -> rslt
|
279
279
|
operand -> ope
|
280
280
|
domain -> dom
|
281
281
|
qualified -> qualed
|
@@ -283,6 +283,8 @@ error -> err
|
|
283
283
|
project -> proj
|
284
284
|
temporary -> tmp
|
285
285
|
referrer-function -> ref_fun
|
286
|
+
sample -> smpl
|
287
|
+
representative -> repr
|
286
288
|
</pre>
|
287
289
|
|
288
290
|
<div class="node">
|
@@ -2,7 +2,7 @@
|
|
2
2
|
@setfilename developers_guide_ja.info
|
3
3
|
@documentlanguage ja
|
4
4
|
@documentencoding utf-8
|
5
|
-
@settitle AdLint 3.0.
|
5
|
+
@settitle AdLint 3.0.10 開発者ガイド
|
6
6
|
|
7
7
|
@copying
|
8
8
|
Copyright (C) 2010-2013, OGIS-RI Co.,Ltd.
|
@@ -98,7 +98,7 @@ definition -> def
|
|
98
98
|
enumerator -> enum
|
99
99
|
member -> memb
|
100
100
|
element -> elem
|
101
|
-
original ->
|
101
|
+
original -> orig
|
102
102
|
converted -> conved
|
103
103
|
conversion -> conv
|
104
104
|
arithmetic -> arith
|
@@ -204,7 +204,7 @@ logical-or -> lor
|
|
204
204
|
relationship -> relat
|
205
205
|
prototype -> proto
|
206
206
|
termination -> term
|
207
|
-
result ->
|
207
|
+
result -> rslt
|
208
208
|
operand -> ope
|
209
209
|
domain -> dom
|
210
210
|
qualified -> qualed
|
@@ -212,6 +212,8 @@ error -> err
|
|
212
212
|
project -> proj
|
213
213
|
temporary -> tmp
|
214
214
|
referrer-function -> ref_fun
|
215
|
+
sample -> smpl
|
216
|
+
representative -> repr
|
215
217
|
@end verbatim
|
216
218
|
|
217
219
|
|
@@ -1,8 +1,8 @@
|
|
1
1
|
<html lang="en">
|
2
2
|
<head>
|
3
|
-
<title>AdLint 3.0.
|
3
|
+
<title>AdLint 3.0.10 User's Guide</title>
|
4
4
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
5
|
-
<meta name="description" content="AdLint 3.0.
|
5
|
+
<meta name="description" content="AdLint 3.0.10 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 3.0.
|
47
|
+
<h1 class="settitle">AdLint 3.0.10 User's Guide</h1>
|
48
48
|
<div class="node">
|
49
49
|
<a name="Top"></a>
|
50
50
|
<p><hr>
|
@@ -1,8 +1,8 @@
|
|
1
1
|
<html lang="ja">
|
2
2
|
<head>
|
3
|
-
<title>AdLint 3.0.
|
3
|
+
<title>AdLint 3.0.10 利用者ガイド</title>
|
4
4
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
5
|
-
<meta name="description" content="AdLint 3.0.
|
5
|
+
<meta name="description" content="AdLint 3.0.10 利用者ガイド">
|
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 3.0.
|
47
|
+
<h1 class="settitle">AdLint 3.0.10 利用者ガイド</h1>
|
48
48
|
<div class="node">
|
49
49
|
<a name="Top"></a>
|
50
50
|
<p><hr>
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: adlint
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.10
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-06-28 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: ! 'AdLint is a source code static analyzer.
|
15
15
|
|
@@ -65,6 +65,7 @@ files:
|
|
65
65
|
- etc/mesg.d/c_builtin/ja_JP/messages.yml
|
66
66
|
- etc/mesg.d/core/en_US/messages.yml
|
67
67
|
- etc/mesg.d/core/ja_JP/messages.yml
|
68
|
+
- features/code_check/E0008.feature
|
68
69
|
- features/code_check/E0013.feature
|
69
70
|
- features/code_check/W0001.feature
|
70
71
|
- features/code_check/W0002.feature
|
@@ -85,6 +86,8 @@ files:
|
|
85
86
|
- features/code_check/W0071.feature
|
86
87
|
- features/code_check/W0088.feature
|
87
88
|
- features/code_check/W0093.feature
|
89
|
+
- features/code_check/W0097.feature
|
90
|
+
- features/code_check/W0100.feature
|
88
91
|
- features/code_check/W0104.feature
|
89
92
|
- features/code_check/W0109.feature
|
90
93
|
- features/code_check/W0119.feature
|
@@ -227,7 +230,9 @@ files:
|
|
227
230
|
- features/code_check/W0425.feature
|
228
231
|
- features/code_check/W0431.feature
|
229
232
|
- features/code_check/W0432.feature
|
233
|
+
- features/code_check/W0459.feature
|
230
234
|
- features/code_check/W0460.feature
|
235
|
+
- features/code_check/W0461.feature
|
231
236
|
- features/code_check/W0477.feature
|
232
237
|
- features/code_check/W0478.feature
|
233
238
|
- features/code_check/W0479.feature
|
@@ -260,6 +265,8 @@ files:
|
|
260
265
|
- features/code_check/W0606.feature
|
261
266
|
- features/code_check/W0610.feature
|
262
267
|
- features/code_check/W0611.feature
|
268
|
+
- features/code_check/W0612.feature
|
269
|
+
- features/code_check/W0613.feature
|
263
270
|
- features/code_check/W0635.feature
|
264
271
|
- features/code_check/W0641.feature
|
265
272
|
- features/code_check/W0642.feature
|
@@ -285,6 +292,7 @@ files:
|
|
285
292
|
- features/code_check/W0699.feature
|
286
293
|
- features/code_check/W0700.feature
|
287
294
|
- features/code_check/W0703.feature
|
295
|
+
- features/code_check/W0704.feature
|
288
296
|
- features/code_check/W0705.feature
|
289
297
|
- features/code_check/W0707.feature
|
290
298
|
- features/code_check/W0708.feature
|
@@ -354,6 +362,7 @@ files:
|
|
354
362
|
- features/code_check/W1041.feature
|
355
363
|
- features/code_check/W1046.feature
|
356
364
|
- features/code_check/W1047.feature
|
365
|
+
- features/code_check/W1050.feature
|
357
366
|
- features/code_check/W1052.feature
|
358
367
|
- features/code_check/W1057.feature
|
359
368
|
- features/code_check/W1058.feature
|