adlint 2.0.2 → 2.0.6

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 CHANGED
@@ -1,3 +1,35 @@
1
+ Thu Aug 30 09:56:15 2012 Yutaka Yanoh <yanoh@users.sourceforge.net>
2
+
3
+ * release.ga : 2.0.6
4
+ - Fix huge memory consumption problem when a multi-dimensional
5
+ variable length array is defined without fully narrowed length.
6
+ - Revise variable cross-reference extraction in order to output only
7
+ about the outmost-variable when its element or member is accessed.
8
+
9
+ Wed Aug 29 17:36:59 2012 Yutaka Yanoh <yanoh@users.sourceforge.net>
10
+
11
+ * release.rc : 2.0.5
12
+ - Revise variable cross-reference extraction in order to output only
13
+ about the outmost-variable when its element or member is accessed.
14
+
15
+ Wed Aug 29 17:26:26 2012 Yutaka Yanoh <yanoh@users.sourceforge.net>
16
+
17
+ * lib/adlint/exam/c_builtin/c_code.rb : Revise variable cross-reference
18
+ extraction in order to output only about the outmost-variable when
19
+ its element or member is accessed.
20
+
21
+ Wed Aug 29 13:02:43 2012 Yutaka Yanoh <yanoh@users.sourceforge.net>
22
+
23
+ * release.rc : 2.0.3
24
+ - Fix huge memory consumption problem when a multi-dimensional
25
+ variable length array is defined without fully narrowed length.
26
+
27
+ Wed Aug 29 11:45:48 2012 Yutaka Yanoh <yanoh@users.sourceforge.net>
28
+
29
+ * lib/adlint/c/value.rb : Revise value sampling behavior of the value
30
+ domain.
31
+ * lib/adlint/c/type.rb : Fix array size evaluation not to fall below 0.
32
+
1
33
  Tue Aug 28 10:28:41 2012 Yutaka Yanoh <yanoh@users.sourceforge.net>
2
34
 
3
35
  * release.ga : 2.0.2
data/INSTALL CHANGED
@@ -41,7 +41,7 @@ or
41
41
  Tiny sample C language projects are bundled with \AdLint gem.
42
42
  You can evaluate \AdLint by following instructions.
43
43
 
44
- First, copy `intro_demo' project into your workspace. "+adlint+ +--prefix+"
44
+ First, copy \`intro_demo' project into your workspace. "+adlint+ +--prefix+"
45
45
  command prints the prefix pathname of the \AdLint installation directory.
46
46
 
47
47
  % cp -r `adlint --prefix`/share/demo/intro_demo .
@@ -77,5 +77,5 @@ Following files will be generated.
77
77
  * [+intro_demo.met.csv+] Cross module metric information.
78
78
  * [+intro_demo.msg.csv+] Cross module warning messages.
79
79
 
80
- `+intro_demo.c.msg.csv+' will tell you that the control will never reach to
81
- some statements and that division by zero will occur in `+intro_demo.c+'.
80
+ \`+intro_demo.c.msg.csv+' will tell you that the control will never reach to
81
+ some statements and that division by zero will occur in \`+intro_demo.c+'.
data/NEWS CHANGED
@@ -21,6 +21,19 @@
21
21
 
22
22
  ++
23
23
 
24
+ === \AdLint 2.0.6 is released (2012-08-30)
25
+
26
+ ==== Changes since the 2.0.2 release
27
+
28
+ * Fix huge memory consumption problem when a multi-dimensional variable length
29
+ array is defined without fully narrowed length
30
+ * Revise variable cross-reference extraction in order to output only about the
31
+ outmost-variable when its element or member is accessed
32
+
33
+ See the file
34
+ {ChangeLog}[http://adlint.sourceforge.net/pmwiki/upload.d/Main/ChangeLog]
35
+ for more details.
36
+
24
37
  === \AdLint 2.0.2 is released (2012-08-28)
25
38
 
26
39
  ==== Changes since the 2.0.0 release
@@ -29,10 +42,6 @@
29
42
  inclusion directive is commented out in the skipping group
30
43
  * Add templates for gcc 4.6.3-1ubuntu5 on Ubuntu 12.04 LTS (64bit)
31
44
 
32
- See the file
33
- {ChangeLog}[http://adlint.sourceforge.net/pmwiki/upload.d/Main/ChangeLog]
34
- for more details.
35
-
36
45
  === \AdLint 2.0.0 is released (2012-08-22)
37
46
 
38
47
  ==== Changes since the 1.18.6 release
@@ -85,13 +94,14 @@ for more details.
85
94
  * Fix W0705 and W0745 detections to warn about not only
86
95
  array-subscript-expressions but also indirection-expressions only when the
87
96
  subscript is constant
88
- * Revise expression evaluation not to give up when a operand is typed as `void'
89
- * Revise arithmetic type resolution not to abort when one type is `void'
97
+ * Revise expression evaluation not to give up when a operand is typed as
98
+ \`void'
99
+ * Revise arithmetic type resolution not to abort when one type is \`void'
90
100
  * Fix declarator evaluation in order to construct a function object which
91
101
  returns a function pointer correctly when the function-definition written
92
102
  without typedefed function pointer
93
103
  * Implement missing semantics of union object initialization
94
- * Revise function-like macro replacement in order to evaluate `#' operator
104
+ * Revise function-like macro replacement in order to evaluate \`#' operator
95
105
  makes an empty string-literal when the parameter corresponding to the operand
96
106
  has no argument
97
107
  * Fix bad sequence-point timing of logical-and-expression and
@@ -144,7 +154,7 @@ for more details.
144
154
  * Add W1070 detection
145
155
  * Add W1072 detection
146
156
  * Fix W0104 detection not to warn when the unchanged parameter is typed with
147
- `const volatile' qualifiers
157
+ \`const volatile' qualifiers
148
158
  * Add W0104, W0645, W0697, W0700, W1066, W1067, W1068, W1069, W1070 and W1072
149
159
  functional specifications
150
160
 
@@ -180,7 +190,7 @@ for more details.
180
190
  * Fix W0501 detection not to duplicate warnings about a conditional-expression
181
191
  * Fix W0582, W0583 and W0584 detections in order to consider type
182
192
  convertibility correctly
183
- * Fix W1031 detection not to warn when the declaration with `static' and
193
+ * Fix W1031 detection not to warn when the declaration with \`static' and
184
194
  definition without storage-class-specifier
185
195
  * Fix lack of sequence-point notification of controlling expressions
186
196
  * Add unit specification of C type models
@@ -206,8 +216,8 @@ for more details.
206
216
  saved
207
217
  * Fix W0828 detection not to warn when the member variable is a type of char
208
218
  array and the corresponding initializer is a string-literal-specifier
209
- * Fix W0635 detection not to warn when the `void *' argument passed as the `%p'
210
- conversion specifier
219
+ * Fix W0635 detection not to warn when the \`void *' argument passed as the
220
+ \`%p' conversion specifier
211
221
  * Fix degraded W0118 detection not to warn when the object declaration is in
212
222
  the header file and the same declaration is in the source file, too
213
223
  * Fix bad value domain multiplication logic in order to correctly detect W0723
@@ -49,7 +49,7 @@
49
49
  # - "ERR:X99"
50
50
  # format: "Your custom message for the error of E9999."
51
51
 
52
- version: "2.0.2"
52
+ version: "2.0.6"
53
53
 
54
54
  message_definition:
55
55
  W0001:
@@ -49,7 +49,7 @@
49
49
  # - "ERR:X99"
50
50
  # format: "Your custom message for the error of E9999."
51
51
 
52
- version: "2.0.2"
52
+ version: "2.0.6"
53
53
 
54
54
  message_definition:
55
55
  W0001:
@@ -49,7 +49,7 @@
49
49
  # - "ERR:X99"
50
50
  # format: "Your custom message for the error of E9999."
51
51
 
52
- version: "2.0.2"
52
+ version: "2.0.6"
53
53
 
54
54
  message_definition:
55
55
  X0001:
@@ -49,7 +49,7 @@
49
49
  # - "ERR:X99"
50
50
  # format: "Your custom message for the error of E9999."
51
51
 
52
- version: "2.0.2"
52
+ version: "2.0.6"
53
53
 
54
54
  message_definition:
55
55
  X0001:
data/lib/adlint/c/type.rb CHANGED
@@ -7632,14 +7632,16 @@ module C #:nodoc:
7632
7632
  if object.variable? && object.value.scalar?
7633
7633
  size = object.value.unique_sample
7634
7634
  end
7635
- size ||= 0
7635
+ # NOTE: Size of an array should be greater than 0.
7636
+ size = 1 if size.nil? || size <= 0
7636
7637
  else
7637
7638
  if size_expression.object_specifiers.empty?
7638
7639
  object = Interpreter.new(@type_table).execute(size_expression)
7639
7640
  if object.variable? && object.value.scalar?
7640
7641
  size = object.value.unique_sample
7641
7642
  end
7642
- size ||= 0
7643
+ # NOTE: Size of an array should be greater than 0.
7644
+ size = 1 if size.nil? || size <= 0
7643
7645
  else
7644
7646
  size = nil
7645
7647
  end
@@ -39,7 +39,7 @@ module C #:nodoc:
39
39
  def unique_sample
40
40
  # NOTE: A value may have multiple sample values.
41
41
  # So, callers of this method have potential bugs!
42
- to_enum.first
42
+ to_enum.to_a.min
43
43
  end
44
44
  end
45
45
 
@@ -372,6 +372,10 @@ module CBuiltin #:nodoc:
372
372
 
373
373
  def extract_variable_read(expression, variable)
374
374
  if @accessor && variable.scope.global? && variable.named?
375
+ # NOTE: When a value of the inner-variable of array or composite object
376
+ # is referred, dependency record of only outmost-variable access
377
+ # should be output.
378
+ variable = variable.owner while variable.inner?
375
379
  XREF_VAR(expression.location,
376
380
  FunctionIdentifier.new(@accessor.name,
377
381
  @accessor.signature.to_s),
@@ -381,10 +385,16 @@ module CBuiltin #:nodoc:
381
385
 
382
386
  def extract_variable_write(expression, variable)
383
387
  if @accessor && variable.scope.global? && variable.named?
384
- XREF_VAR(expression.location,
385
- FunctionIdentifier.new(@accessor.name,
386
- @accessor.signature.to_s),
387
- "W", variable.name)
388
+ unless variable.inner?
389
+ # NOTE: When a value of the inner-variable of array or composite
390
+ # object is updated, dependency record of the inner-variable
391
+ # access should not be output and the outer variable's value
392
+ # will also be notified later.
393
+ XREF_VAR(expression.location,
394
+ FunctionIdentifier.new(@accessor.name,
395
+ @accessor.signature.to_s),
396
+ "W", variable.name)
397
+ end
388
398
  end
389
399
  end
390
400
 
@@ -33,8 +33,8 @@ module AdLint #:nodoc:
33
33
 
34
34
  MAJOR_VERSION = 2
35
35
  MINOR_VERSION = 0
36
- PATCH_VERSION = 2
37
- RELEASE_DATE = "2012-08-28"
36
+ PATCH_VERSION = 6
37
+ RELEASE_DATE = "2012-08-30"
38
38
 
39
39
  TRAITS_SCHEMA_VERSION = "2.0.0"
40
40
 
@@ -1,8 +1,8 @@
1
1
  <html lang="ja">
2
2
  <head>
3
- <title>AdLint 2.0.2 開発者ガイド</title>
3
+ <title>AdLint 2.0.6 開発者ガイド</title>
4
4
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
5
- <meta name="description" content="AdLint 2.0.2 開発者ガイド">
5
+ <meta name="description" content="AdLint 2.0.6 開発者ガイド">
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 2.0.2 開発者ガイド</h1>
47
+ <h1 class="settitle">AdLint 2.0.6 開発者ガイド</h1>
48
48
  <div class="contents">
49
49
  <h2>Table of Contents</h2>
50
50
  <ul>
@@ -2,7 +2,7 @@
2
2
  @setfilename developers_guide_ja.info
3
3
  @documentlanguage ja
4
4
  @documentencoding utf-8
5
- @settitle AdLint 2.0.2 開発者ガイド
5
+ @settitle AdLint 2.0.6 開発者ガイド
6
6
 
7
7
  @copying
8
8
  Copyright (C) 2010-2012, OGIS-RI Co.,Ltd.
@@ -21,7 +21,15 @@
21
21
 
22
22
  # Schema version of the traits file.
23
23
  # DO NOT EDIT MANUALLY!
24
- version: "1.0.0"
24
+ version: "2.0.0"
25
+
26
+ # List of names of source code examination packages.
27
+ #
28
+ # "c_builtin" is a builtin source code examination package for C language.
29
+ # You can install optional examination packages and append (or replace) this
30
+ # list to specify which examination packages are to be run.
31
+ exam_packages:
32
+ - "c_builtin"
25
33
 
26
34
  #
27
35
  # Project specific traits section
@@ -231,8 +239,53 @@ message_traits:
231
239
  # Please help to translate the message catalog into your language.
232
240
  language: "ja_JP"
233
241
 
242
+ # Output messages with category and severity information?
243
+ message_with_class: false
244
+
245
+ # Warn only files in the specified directory. If omitted, all files (such as
246
+ # system headers or 3rd-party library headers) will be warned.
247
+ warn_only_files_in: ".."
248
+
249
+ # Enable translation-unit specific code check selection?
250
+ individual_selection: true
251
+
252
+ # Project-wide code check exclusion settings.
253
+ # Ex.
254
+ # exclusion:
255
+ # categories:
256
+ # - "REL"
257
+ # - "PRT"
258
+ # severities: "[ABC][5-9][0-9]"
259
+ # messages:
260
+ # W0001: "c_builtin"
261
+ # W0002: "c_ansi"
262
+ exclusion:
263
+
264
+ # Project-wide code check inclusion settings.
265
+ # Ex.
266
+ # inclusion:
267
+ # messages:
268
+ # W0001: "c_builtin"
269
+ # W0002: "c_ansi"
270
+ inclusion:
271
+
234
272
  # Message text replacement.
235
273
  # Ex.
236
274
  # change_list:
237
- # W9999: "Your custom message for the warning of #9999."
275
+ # W9999:
276
+ # package: "c_builtin"
277
+ # classes:
278
+ # - "REL:A10"
279
+ # - "PRT:B20"
280
+ # format: "Your custom message for the warning of W9999."
281
+ # X9999:
282
+ # package: "core"
283
+ # classes:
284
+ # - "ERR:X99"
285
+ # format: "Your custom message for the warning of X9999."
286
+ # E9999:
287
+ # package: "core"
288
+ # classes:
289
+ # - "ERR:X99"
290
+ # format: "Your custom message for the warning of E9999."
238
291
  change_list:
@@ -1,8 +1,8 @@
1
1
  <html lang="en">
2
2
  <head>
3
- <title>AdLint 2.0.2 User's Guide</title>
3
+ <title>AdLint 2.0.6 User's Guide</title>
4
4
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
5
- <meta name="description" content="AdLint 2.0.2 User's Guide">
5
+ <meta name="description" content="AdLint 2.0.6 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 2.0.2 User's Guide</h1>
47
+ <h1 class="settitle">AdLint 2.0.6 User's Guide</h1>
48
48
  <div class="node">
49
49
  <a name="Top"></a>
50
50
  <p><hr>
@@ -42776,7 +42776,15 @@ It will be able to check easily the code quality during development.
42776
42776
 
42777
42777
  # Schema version of the traits file.
42778
42778
  # DO NOT EDIT MANUALLY!
42779
- version: "1.0.0"
42779
+ version: "2.0.0"
42780
+
42781
+ # List of names of source code examination packages.
42782
+ #
42783
+ # "c_builtin" is a builtin source code examination package for C language.
42784
+ # You can install optional examination packages and append (or replace) this
42785
+ # list to specify which examination packages are to be run.
42786
+ exam_packages:
42787
+ - "c_builtin"
42780
42788
 
42781
42789
  #
42782
42790
  # Project specific traits section
@@ -42986,10 +42994,55 @@ message_traits:
42986
42994
  # Please help to translate the message catalog into your language.
42987
42995
  language: "ja_JP"
42988
42996
 
42997
+ # Output messages with category and severity information?
42998
+ message_with_class: false
42999
+
43000
+ # Warn only files in the specified directory. If omitted, all files (such as
43001
+ # system headers or 3rd-party library headers) will be warned.
43002
+ warn_only_files_in: ".."
43003
+
43004
+ # Enable translation-unit specific code check selection?
43005
+ individual_selection: true
43006
+
43007
+ # Project-wide code check exclusion settings.
43008
+ # Ex.
43009
+ # exclusion:
43010
+ # categories:
43011
+ # - "REL"
43012
+ # - "PRT"
43013
+ # severities: "[ABC][5-9][0-9]"
43014
+ # messages:
43015
+ # W0001: "c_builtin"
43016
+ # W0002: "c_ansi"
43017
+ exclusion:
43018
+
43019
+ # Project-wide code check inclusion settings.
43020
+ # Ex.
43021
+ # inclusion:
43022
+ # messages:
43023
+ # W0001: "c_builtin"
43024
+ # W0002: "c_ansi"
43025
+ inclusion:
43026
+
42989
43027
  # Message text replacement.
42990
43028
  # Ex.
42991
43029
  # change_list:
42992
- # W9999: "Your custom message for the warning of #9999."
43030
+ # W9999:
43031
+ # package: "c_builtin"
43032
+ # classes:
43033
+ # - "REL:A10"
43034
+ # - "PRT:B20"
43035
+ # format: "Your custom message for the warning of W9999."
43036
+ # X9999:
43037
+ # package: "core"
43038
+ # classes:
43039
+ # - "ERR:X99"
43040
+ # format: "Your custom message for the warning of X9999."
43041
+ # E9999:
43042
+ # package: "core"
43043
+ # classes:
43044
+ # - "ERR:X99"
43045
+ # format: "Your custom message for the warning of E9999."
42993
43046
  change_list:
42994
43047
  </pre>
42995
43048
  <a name="GNUmakefile-Sample"></a>
@@ -2,7 +2,7 @@
2
2
  @setfilename users_guide_en.info
3
3
  @documentlanguage en
4
4
  @documentencoding utf-8
5
- @settitle AdLint 2.0.2 User's Guide
5
+ @settitle AdLint 2.0.6 User's Guide
6
6
 
7
7
  @copying
8
8
  Copyright (C) 2010-2012, OGIS-RI Co.,Ltd.
@@ -1,8 +1,8 @@
1
1
  <html lang="ja">
2
2
  <head>
3
- <title>AdLint 2.0.2 利用者ガイド</title>
3
+ <title>AdLint 2.0.6 利用者ガイド</title>
4
4
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
5
- <meta name="description" content="AdLint 2.0.2 利用者ガイド">
5
+ <meta name="description" content="AdLint 2.0.6 利用者ガイド">
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 2.0.2 利用者ガイド</h1>
47
+ <h1 class="settitle">AdLint 2.0.6 利用者ガイド</h1>
48
48
  <div class="node">
49
49
  <a name="Top"></a>
50
50
  <p><hr>
@@ -43236,7 +43236,15 @@ Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>
43236
43236
 
43237
43237
  # Schema version of the traits file.
43238
43238
  # DO NOT EDIT MANUALLY!
43239
- version: "1.0.0"
43239
+ version: "2.0.0"
43240
+
43241
+ # List of names of source code examination packages.
43242
+ #
43243
+ # "c_builtin" is a builtin source code examination package for C language.
43244
+ # You can install optional examination packages and append (or replace) this
43245
+ # list to specify which examination packages are to be run.
43246
+ exam_packages:
43247
+ - "c_builtin"
43240
43248
 
43241
43249
  #
43242
43250
  # Project specific traits section
@@ -43446,10 +43454,55 @@ message_traits:
43446
43454
  # Please help to translate the message catalog into your language.
43447
43455
  language: "ja_JP"
43448
43456
 
43457
+ # Output messages with category and severity information?
43458
+ message_with_class: false
43459
+
43460
+ # Warn only files in the specified directory. If omitted, all files (such as
43461
+ # system headers or 3rd-party library headers) will be warned.
43462
+ warn_only_files_in: ".."
43463
+
43464
+ # Enable translation-unit specific code check selection?
43465
+ individual_selection: true
43466
+
43467
+ # Project-wide code check exclusion settings.
43468
+ # Ex.
43469
+ # exclusion:
43470
+ # categories:
43471
+ # - "REL"
43472
+ # - "PRT"
43473
+ # severities: "[ABC][5-9][0-9]"
43474
+ # messages:
43475
+ # W0001: "c_builtin"
43476
+ # W0002: "c_ansi"
43477
+ exclusion:
43478
+
43479
+ # Project-wide code check inclusion settings.
43480
+ # Ex.
43481
+ # inclusion:
43482
+ # messages:
43483
+ # W0001: "c_builtin"
43484
+ # W0002: "c_ansi"
43485
+ inclusion:
43486
+
43449
43487
  # Message text replacement.
43450
43488
  # Ex.
43451
43489
  # change_list:
43452
- # W9999: "Your custom message for the warning of #9999."
43490
+ # W9999:
43491
+ # package: "c_builtin"
43492
+ # classes:
43493
+ # - "REL:A10"
43494
+ # - "PRT:B20"
43495
+ # format: "Your custom message for the warning of W9999."
43496
+ # X9999:
43497
+ # package: "core"
43498
+ # classes:
43499
+ # - "ERR:X99"
43500
+ # format: "Your custom message for the warning of X9999."
43501
+ # E9999:
43502
+ # package: "core"
43503
+ # classes:
43504
+ # - "ERR:X99"
43505
+ # format: "Your custom message for the warning of E9999."
43453
43506
  change_list:
43454
43507
  </pre>
43455
43508
  <a name="GNUmakefile-Sample"></a>
@@ -2,7 +2,7 @@
2
2
  @setfilename users_guide_ja.info
3
3
  @documentlanguage ja
4
4
  @documentencoding utf-8
5
- @settitle AdLint 2.0.2 利用者ガイド
5
+ @settitle AdLint 2.0.6 利用者ガイド
6
6
 
7
7
  @copying
8
8
  Copyright (C) 2010-2012, OGIS-RI Co.,Ltd.
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: 2.0.2
4
+ version: 2.0.6
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: 2012-08-28 00:00:00.000000000 Z
12
+ date: 2012-08-30 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: ! 'AdLint is a source code static analyzer.
15
15