adlint 2.0.0 → 2.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/ChangeLog CHANGED
@@ -1,3 +1,34 @@
1
+ Tue Aug 28 10:28:41 2012 Yutaka Yanoh <yanoh@users.sourceforge.net>
2
+
3
+ * release.ga : 2.0.2
4
+ - Fix bad group skipping problem of the preprocessor when a
5
+ conditional inclusion directive is commented out in the skipping
6
+ group.
7
+ - Add templates for gcc 4.6.3-1ubuntu5 on Ubuntu 12.04 LTS (64bit).
8
+
9
+ Mon Aug 27 16:54:52 2012 Yutaka Yanoh <yanoh@users.sourceforge.net>
10
+
11
+ * release.rc : 2.0.1
12
+ - Fix bad group skipping problem of the preprocessor when a
13
+ conditional inclusion directive is commented out in the skipping
14
+ group.
15
+ - Add templates for gcc 4.6.3-1ubuntu5 on Ubuntu 12.04 LTS (64bit).
16
+
17
+ Mon Aug 27 16:49:19 2012 Yutaka Yanoh <yanoh@users.sourceforge.net>
18
+
19
+ * etc/conf.d/x86_64-ubuntu_12.04/traits-gcc_4.6.3.erb : Add templates
20
+ for gcc 4.6.3-1ubuntu5 on Ubuntu 12.04 LTS (64bit).
21
+ * etc/conf.d/x86_64-ubuntu_12.04/cinit-gcc_4.6.3.erb : Ditto.
22
+
23
+ Mon Aug 27 15:53:32 2012 Yutaka Yanoh <yanoh@users.sourceforge.net>
24
+
25
+ * lib/adlint/cpp/lexer.rb : Fix bad group skipping problem of the
26
+ preprocessor when a conditional inclusion directive is commented out
27
+ in the skipping group.
28
+
29
+ * lib/adlint/lexer.rb : Add StringContent#_debug_inspect method in
30
+ order to ease debugging.
31
+
1
32
  Wed Aug 22 14:41:15 2012 Yutaka Yanoh <yanoh@users.sourceforge.net>
2
33
 
3
34
  * release.ga : 2.0.0
@@ -117,6 +148,7 @@ Thu Aug 16 15:10:17 2012 Rie Shima <rkakuuchi@users.sourceforge.net>
117
148
  Wed Aug 15 15:18:53 2012 Yutaka Yanoh <yanoh@users.sourceforge.net>
118
149
 
119
150
  * release.rc : 1.19.0
151
+ - This is the initial release candidate for 2.0.0 GA release.
120
152
  - In preparation for using optional source code examination packages,
121
153
  refine internal module structure and revise format of the traits
122
154
  file.
data/MANIFEST CHANGED
@@ -26,6 +26,8 @@ etc/conf.d/noarch/GNUmakefile.erb
26
26
  etc/conf.d/noarch/adlint_all_bat.erb
27
27
  etc/conf.d/noarch/adlint_all_sh.erb
28
28
  etc/conf.d/noarch/pinit.erb
29
+ etc/conf.d/x86_64-ubuntu_12.04/cinit-gcc_4.6.3.erb
30
+ etc/conf.d/x86_64-ubuntu_12.04/traits-gcc_4.6.3.erb
29
31
  etc/mesg.d/c_builtin/en_US/messages.yml
30
32
  etc/mesg.d/c_builtin/ja_JP/messages.yml
31
33
  etc/mesg.d/core/en_US/messages.yml
data/NEWS CHANGED
@@ -21,6 +21,18 @@
21
21
 
22
22
  ++
23
23
 
24
+ === \AdLint 2.0.2 is released (2012-08-28)
25
+
26
+ ==== Changes since the 2.0.0 release
27
+
28
+ * Fix bad group skipping problem of the preprocessor when a conditional
29
+ inclusion directive is commented out in the skipping group
30
+ * Add templates for gcc 4.6.3-1ubuntu5 on Ubuntu 12.04 LTS (64bit)
31
+
32
+ See the file
33
+ {ChangeLog}[http://adlint.sourceforge.net/pmwiki/upload.d/Main/ChangeLog]
34
+ for more details.
35
+
24
36
  === \AdLint 2.0.0 is released (2012-08-22)
25
37
 
26
38
  ==== Changes since the 1.18.6 release
@@ -33,10 +45,6 @@
33
45
  suppression of unconcerned headers such as system headers
34
46
  * Add many more functional specifications of builtin code checks
35
47
 
36
- See the file
37
- {ChangeLog}[http://adlint.sourceforge.net/pmwiki/upload.d/Main/ChangeLog]
38
- for more details.
39
-
40
48
  === \AdLint 1.18.6 is released (2012-08-14)
41
49
 
42
50
  ==== Changes since the 1.18.2 release
data/TODO CHANGED
@@ -23,6 +23,6 @@
23
23
 
24
24
  * Support many more preset build environments
25
25
  * Implement automatic traits files generator
26
- * Improve performance
26
+ * Improve accuracy of code checks
27
27
 
28
28
  Any contributions are welcome!
@@ -0,0 +1,230 @@
1
+ /* ___ ____ __ ___ _________
2
+ * / | / _ |/ / / / | / /__ __/ Source Code Static Analyzer
3
+ * / /| | / / / / / / / |/ / / / AdLint - Advanced Lint
4
+ * / __ |/ /_/ / /___/ / /| / / /
5
+ * /_/ |_|_____/_____/_/_/ |_/ /_/ Copyright (C) 2010-2012, OGIS-RI Co.,Ltd.
6
+ *
7
+ * Initial header for GCC 4.6.3 on Ubuntu 12.04 LTS (64bit) generated by adlintize <%= AdLint::SHORT_VERSION %>
8
+ */
9
+
10
+ #define __DBL_MIN_EXP__ (-1021)
11
+ #define __UINT_LEAST16_MAX__ 65535
12
+ #define __FLT_MIN__ 1.17549435082228750797e-38F
13
+ #define __UINT_LEAST8_TYPE__ unsigned char
14
+ #define __INTMAX_C(c) c ## L
15
+ #define __CHAR_BIT__ 8
16
+ #define __UINT8_MAX__ 255
17
+ #define __WINT_MAX__ 4294967295U
18
+ #define __ORDER_LITTLE_ENDIAN__ 1234
19
+ #define __SIZE_MAX__ 18446744073709551615UL
20
+ #define __WCHAR_MAX__ 2147483647
21
+ #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 1
22
+ #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_2 1
23
+ #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 1
24
+ #define __DBL_DENORM_MIN__ ((double)4.94065645841246544177e-324L)
25
+ #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8 1
26
+ #define __FLT_EVAL_METHOD__ 0
27
+ #define __unix__ 1
28
+ #define __x86_64 1
29
+ #define __UINT_FAST64_MAX__ 18446744073709551615UL
30
+ #define __SIG_ATOMIC_TYPE__ int
31
+ #define __DBL_MIN_10_EXP__ (-307)
32
+ #define __FINITE_MATH_ONLY__ 0
33
+ #define __GNUC_PATCHLEVEL__ 3
34
+ #define __UINT_FAST8_MAX__ 255
35
+ #define __DEC64_MAX_EXP__ 385
36
+ #define __INT8_C(c) c
37
+ #define __UINT_LEAST64_MAX__ 18446744073709551615UL
38
+ #define __SHRT_MAX__ 32767
39
+ #define __LDBL_MAX__ 1.18973149535723176502e+4932L
40
+ #define __UINT_LEAST8_MAX__ 255
41
+ #define __UINTMAX_TYPE__ long unsigned int
42
+ #define __linux 1
43
+ #define __DEC32_EPSILON__ 1E-6DF
44
+ #define __unix 1
45
+ #define __UINT32_MAX__ 4294967295U
46
+ #define __LDBL_MAX_EXP__ 16384
47
+ #define __WINT_MIN__ 0U
48
+ #define __linux__ 1
49
+ #define __SCHAR_MAX__ 127
50
+ #define __WCHAR_MIN__ (-__WCHAR_MAX__ - 1)
51
+ #define __INT64_C(c) c ## L
52
+ #define __DBL_DIG__ 15
53
+ #define _FORTIFY_SOURCE 2
54
+ #define __SIZEOF_INT__ 4
55
+ #define __SIZEOF_POINTER__ 8
56
+ #define __USER_LABEL_PREFIX__
57
+ #define __STDC_HOSTED__ 1
58
+ #define __LDBL_HAS_INFINITY__ 1
59
+ #define __FLT_EPSILON__ 1.19209289550781250000e-7F
60
+ #define __LDBL_MIN__ 3.36210314311209350626e-4932L
61
+ #define __DEC32_MAX__ 9.999999E96DF
62
+ #define __INT32_MAX__ 2147483647
63
+ #define __SIZEOF_LONG__ 8
64
+ #define __UINT16_C(c) c
65
+ #define __DECIMAL_DIG__ 21
66
+ #define __gnu_linux__ 1
67
+ #define __LDBL_HAS_QUIET_NAN__ 1
68
+ #define __GNUC__ 4
69
+ #define __MMX__ 1
70
+ #define __FLT_HAS_DENORM__ 1
71
+ #define __SIZEOF_LONG_DOUBLE__ 16
72
+ #define __BIGGEST_ALIGNMENT__ 16
73
+ #define __DBL_MAX__ ((double)1.79769313486231570815e+308L)
74
+ #define __INT_FAST32_MAX__ 9223372036854775807L
75
+ #define __DBL_HAS_INFINITY__ 1
76
+ #define __DEC32_MIN_EXP__ (-94)
77
+ #define __INT_FAST16_TYPE__ long int
78
+ #define __LDBL_HAS_DENORM__ 1
79
+ #define __DEC128_MAX__ 9.999999999999999999999999999999999E6144DL
80
+ #define __INT_LEAST32_MAX__ 2147483647
81
+ #define __DEC32_MIN__ 1E-95DF
82
+ #define __DBL_MAX_EXP__ 1024
83
+ #define __DEC128_EPSILON__ 1E-33DL
84
+ #define __SSE2_MATH__ 1
85
+ #define __PTRDIFF_MAX__ 9223372036854775807L
86
+ #define __amd64 1
87
+ #define __LONG_LONG_MAX__ 9223372036854775807LL
88
+ #define __SIZEOF_SIZE_T__ 8
89
+ #define __SIZEOF_WINT_T__ 4
90
+ #define __GCC_HAVE_DWARF2_CFI_ASM 1
91
+ #define __GXX_ABI_VERSION 1002
92
+ #define __FLT_MIN_EXP__ (-125)
93
+ #define __INT_FAST64_TYPE__ long int
94
+ #define __DBL_MIN__ ((double)2.22507385850720138309e-308L)
95
+ #define __LP64__ 1
96
+ #define __DECIMAL_BID_FORMAT__ 1
97
+ #define __DEC128_MIN__ 1E-6143DL
98
+ #define __REGISTER_PREFIX__
99
+ #define __UINT16_MAX__ 65535
100
+ #define __DBL_HAS_DENORM__ 1
101
+ #define __UINT8_TYPE__ unsigned char
102
+ #define __NO_INLINE__ 1
103
+ #define __FLT_MANT_DIG__ 24
104
+ #define __VERSION__ "4.6.3"
105
+ #define __UINT64_C(c) c ## UL
106
+ #define __FLOAT_WORD_ORDER__ __ORDER_LITTLE_ENDIAN__
107
+ #define __INT32_C(c) c
108
+ #define __DEC64_EPSILON__ 1E-15DD
109
+ #define __ORDER_PDP_ENDIAN__ 3412
110
+ #define __DEC128_MIN_EXP__ (-6142)
111
+ #define __INT_FAST32_TYPE__ long int
112
+ #define __UINT_LEAST16_TYPE__ short unsigned int
113
+ #define unix 1
114
+ #define __INT16_MAX__ 32767
115
+ #define __SIZE_TYPE__ long unsigned int
116
+ #define __UINT64_MAX__ 18446744073709551615UL
117
+ #define __INT8_TYPE__ signed char
118
+ #define __ELF__ 1
119
+ #define __FLT_RADIX__ 2
120
+ #define __INT_LEAST16_TYPE__ short int
121
+ #define __LDBL_EPSILON__ 1.08420217248550443401e-19L
122
+ #define __UINTMAX_C(c) c ## UL
123
+ #define __SSE_MATH__ 1
124
+ #define __k8 1
125
+ #define __SIG_ATOMIC_MAX__ 2147483647
126
+ #define __SIZEOF_PTRDIFF_T__ 8
127
+ #define __x86_64__ 1
128
+ #define __DEC32_SUBNORMAL_MIN__ 0.000001E-95DF
129
+ #define __INT_FAST16_MAX__ 9223372036854775807L
130
+ #define __UINT_FAST32_MAX__ 18446744073709551615UL
131
+ #define __UINT_LEAST64_TYPE__ long unsigned int
132
+ #define __FLT_HAS_QUIET_NAN__ 1
133
+ #define __FLT_MAX_10_EXP__ 38
134
+ #define __LONG_MAX__ 9223372036854775807L
135
+ #define __DEC128_SUBNORMAL_MIN__ 0.000000000000000000000000000000001E-6143DL
136
+ #define __FLT_HAS_INFINITY__ 1
137
+ #define __UINT_FAST16_TYPE__ long unsigned int
138
+ #define __DEC64_MAX__ 9.999999999999999E384DD
139
+ #define __CHAR16_TYPE__ short unsigned int
140
+ #define __PRAGMA_REDEFINE_EXTNAME 1
141
+ #define __INT_LEAST16_MAX__ 32767
142
+ #define __DEC64_MANT_DIG__ 16
143
+ #define __INT64_MAX__ 9223372036854775807L
144
+ #define __UINT_LEAST32_MAX__ 4294967295U
145
+ #define __INT_LEAST64_TYPE__ long int
146
+ #define __INT16_TYPE__ short int
147
+ #define __INT_LEAST8_TYPE__ signed char
148
+ #define __DEC32_MAX_EXP__ 97
149
+ #define __INT_FAST8_MAX__ 127
150
+ #define __INTPTR_MAX__ 9223372036854775807L
151
+ #define linux 1
152
+ #define __SSE2__ 1
153
+ #define __LDBL_MANT_DIG__ 64
154
+ #define __DBL_HAS_QUIET_NAN__ 1
155
+ #define __SIG_ATOMIC_MIN__ (-__SIG_ATOMIC_MAX__ - 1)
156
+ #define __k8__ 1
157
+ #define __INTPTR_TYPE__ long int
158
+ #define __UINT16_TYPE__ short unsigned int
159
+ #define __WCHAR_TYPE__ int
160
+ #define __SIZEOF_FLOAT__ 4
161
+ #define __UINTPTR_MAX__ 18446744073709551615UL
162
+ #define __DEC64_MIN_EXP__ (-382)
163
+ #define __INT_FAST64_MAX__ 9223372036854775807L
164
+ #define __FLT_DIG__ 6
165
+ #define __UINT_FAST64_TYPE__ long unsigned int
166
+ #define __INT_MAX__ 2147483647
167
+ #define __amd64__ 1
168
+ #define __INT64_TYPE__ long int
169
+ #define __FLT_MAX_EXP__ 128
170
+ #define __ORDER_BIG_ENDIAN__ 4321
171
+ #define __DBL_MANT_DIG__ 53
172
+ #define __INT_LEAST64_MAX__ 9223372036854775807L
173
+ #define __DEC64_MIN__ 1E-383DD
174
+ #define __WINT_TYPE__ unsigned int
175
+ #define __UINT_LEAST32_TYPE__ unsigned int
176
+ #define __SIZEOF_SHORT__ 2
177
+ #define __SSE__ 1
178
+ #define __LDBL_MIN_EXP__ (-16381)
179
+ #define __INT_LEAST8_MAX__ 127
180
+ #define __SSP__ 1
181
+ #define __SIZEOF_INT128__ 16
182
+ #define __LDBL_MAX_10_EXP__ 4932
183
+ #define __DBL_EPSILON__ ((double)2.22044604925031308085e-16L)
184
+ #define _LP64 1
185
+ #define __UINT8_C(c) c
186
+ #define __INT_LEAST32_TYPE__ int
187
+ #define __SIZEOF_WCHAR_T__ 4
188
+ #define __UINT64_TYPE__ long unsigned int
189
+ #define __INT_FAST8_TYPE__ signed char
190
+ #define __DBL_DECIMAL_DIG__ 17
191
+ #define __DEC_EVAL_METHOD__ 2
192
+ #define __UINT32_C(c) c ## U
193
+ #define __INTMAX_MAX__ 9223372036854775807L
194
+ #define __BYTE_ORDER__ __ORDER_LITTLE_ENDIAN__
195
+ #define __FLT_DENORM_MIN__ 1.40129846432481707092e-45F
196
+ #define __INT8_MAX__ 127
197
+ #define __UINT_FAST32_TYPE__ long unsigned int
198
+ #define __CHAR32_TYPE__ unsigned int
199
+ #define __FLT_MAX__ 3.40282346638528859812e+38F
200
+ #define __INT32_TYPE__ int
201
+ #define __SIZEOF_DOUBLE__ 8
202
+ #define __FLT_MIN_10_EXP__ (-37)
203
+ #define __INTMAX_TYPE__ long int
204
+ #define __DEC128_MAX_EXP__ 6145
205
+ #define __GNUC_MINOR__ 6
206
+ #define __UINTMAX_MAX__ 18446744073709551615UL
207
+ #define __DEC32_MANT_DIG__ 7
208
+ #define __DBL_MAX_10_EXP__ 308
209
+ #define __LDBL_DENORM_MIN__ 3.64519953188247460253e-4951L
210
+ #define __INT16_C(c) c
211
+ #define __STDC__ 1
212
+ #define __PTRDIFF_TYPE__ long int
213
+ #define __UINT32_TYPE__ unsigned int
214
+ #define __UINTPTR_TYPE__ long unsigned int
215
+ #define __DEC64_SUBNORMAL_MIN__ 0.000000000000001E-383DD
216
+ #define __DEC128_MANT_DIG__ 34
217
+ #define __LDBL_MIN_10_EXP__ (-4931)
218
+ #define __SIZEOF_LONG_LONG__ 8
219
+ #define __LDBL_DIG__ 18
220
+ #define __FLT_DECIMAL_DIG__ 9
221
+ #define __UINT_FAST16_MAX__ 18446744073709551615UL
222
+ #define __GNUC_GNU_INLINE__ 1
223
+ #define __UINT_FAST8_TYPE__ unsigned char
224
+
225
+ #define __builtin_va_list void *
226
+ #define __builtin_va_start(a, b) (0)
227
+ #define __builtin_va_end(a) (0)
228
+ #define __builtin_va_arg(ar, t) (0)
229
+ #define __builtin_va_copy(d, s) (0)
230
+ #define __builtin_offsetof(type, member) (0)
@@ -0,0 +1,284 @@
1
+ # ___ ____ __ ___ _________
2
+ # / | / _ |/ / / / | / /__ __/ Source Code Static Analyzer
3
+ # / /| | / / / / / / / |/ / / / AdLint - Advanced Lint
4
+ # / __ |/ /_/ / /___/ / /| / / /
5
+ # /_/ |_|_____/_____/_/_/ |_/ /_/ Copyright (C) 2010-2012, OGIS-RI Co.,Ltd.
6
+ #
7
+ # Traits file generated by adlintize <%= AdLint::SHORT_VERSION %> at <%= Time.now %>.
8
+
9
+ # Schema version of the traits file.
10
+ # DO NOT EDIT MANUALLY!
11
+ version: "<%= AdLint::TRAITS_SCHEMA_VERSION %>"
12
+
13
+ # List of names of source code examination packages.
14
+ #
15
+ # "c_builtin" is a builtin source code examination package for C language.
16
+ # You can install optional examination packages and append (or replace) this
17
+ # list to specify which examination packages are to be run.
18
+ exam_packages:
19
+ - "c_builtin"
20
+
21
+ #
22
+ # Project specific traits section
23
+ #
24
+ project_traits:
25
+
26
+ # Project name.
27
+ project_name: "<%= project_name %>"
28
+
29
+ # Project specific additional include paths.
30
+ # Ex.
31
+ # include_path:
32
+ # - "include/foo"
33
+ # - "../include/bar"
34
+ # - "/opt/baz/include"
35
+ include_path:
36
+
37
+ # Pathname of the project specific initial header file.
38
+ # This header file is automatically included above the first line of the
39
+ # target source file.
40
+ initial_header: "<%= pinit_fpath.basename %>"
41
+
42
+ #
43
+ # Project specific coding style section
44
+ #
45
+ coding_style:
46
+
47
+ # Indent style which is a convention governing the identation of blocks.
48
+ # Select from "K&R", "Allman" and "GNU".
49
+ #
50
+ # The value "K&R" means...
51
+ # int foo(int i)
52
+ # {
53
+ # if (i == 0) {
54
+ # return 0;
55
+ # }
56
+ # return i;
57
+ # }
58
+ #
59
+ # The value "Allman" means...
60
+ # int foo(int i)
61
+ # {
62
+ # if (i == 0)
63
+ # {
64
+ # return 0;
65
+ # }
66
+ # return i;
67
+ # }
68
+ #
69
+ # The value "GNU" means...
70
+ # int
71
+ # foo(int i)
72
+ # {
73
+ # if (i == 0)
74
+ # {
75
+ # return 0;
76
+ # }
77
+ # return i;
78
+ # }
79
+ indent_style: "K&R"
80
+
81
+ # Appearance width of a TAB character.
82
+ tab_width: 8
83
+
84
+ # Appearance width of 1-level of the indentation.
85
+ indent_width: 4
86
+
87
+ # Character encoding of source files.
88
+ file_encoding: "utf-8"
89
+
90
+ #
91
+ # Compiler specific traits section
92
+ #
93
+ compiler_traits:
94
+
95
+ # Pathname of the compiler specific initial header file.
96
+ # This header file is automatically included above the first line of the
97
+ # project specific initial header file.
98
+ initial_header: "<%= cinit_fpath.basename %>"
99
+
100
+ #
101
+ # Compiler specific standard type section
102
+ #
103
+ standard_type:
104
+
105
+ # Bit size of the `char' type family.
106
+ char_size: 8
107
+ # Bit size of the alignment of the `char' type family.
108
+ char_alignment: 8
109
+
110
+ # Bit size of the `short' type family.
111
+ short_size: 16
112
+ # Bit size of the alignment of the `short' type family.
113
+ short_alignment: 16
114
+
115
+ # Bit size of the `int' type family.
116
+ int_size: 32
117
+ # Bit size of the alignment of the `int' type family.
118
+ int_alignment: 32
119
+
120
+ # Bit size of the `long int' type family.
121
+ long_size: 64
122
+ # Bit size of the alignment of the `long int' type family.
123
+ long_alignment: 64
124
+
125
+ # Bit size of the `long long int' type family.
126
+ long_long_size: 64
127
+ # Bit size of the alignment of the `long long int' type family.
128
+ long_long_alignment: 64
129
+
130
+ # Bit size of the `float' type.
131
+ float_size: 32
132
+ # Bit size of the alignment of the `float' type.
133
+ float_alignment: 32
134
+
135
+ # Bit size of the `double' type.
136
+ double_size: 64
137
+ # Bit size of the alignment of the `double' type.
138
+ double_alignment: 64
139
+
140
+ # Bit size of the `long double' type.
141
+ long_double_size: 128
142
+ # Bit size of the alignment of the `long double' type.
143
+ long_double_alignment: 128
144
+
145
+ # Bit size of the pointer to functions.
146
+ code_ptr_size: 64
147
+ # Bit size of the alignment of the pointer to functions.
148
+ code_ptr_alignment: 64
149
+
150
+ # Bit size of the pointer to data.
151
+ data_ptr_size: 64
152
+ # Bit size of the alignment of the pointer to data.
153
+ data_ptr_alignment: 64
154
+
155
+ # Treat the `char' type as same as the `unsigned char' type?
156
+ char_as_unsigned_char: true
157
+
158
+ # Compiler specific include paths.
159
+ # Ex.
160
+ # include_path:
161
+ # - "/usr/include"
162
+ # - "/usr/local/include"
163
+ include_path:
164
+ - "/usr/lib/gcc/x86_64-linux-gnu/4.6/include"
165
+ - "/usr/local/include"
166
+ - "/usr/lib/gcc/x86_64-linux-gnu/4.6/include-fixed"
167
+ - "/usr/include/x86_64-linux-gnu"
168
+ - "/usr/include"
169
+
170
+ # Treat the `>>' operator as a logical shift, not an arithmetic shift?
171
+ arithmetic:
172
+ logical_right_shift: true
173
+
174
+ # Token substitution setting to warn the use of compiler specific extensions.
175
+ #
176
+ # If your compiler supports `__attribute__(...)' extension and you want to
177
+ # know the use of this extension, specify as below.
178
+ # extension_substitution:
179
+ # "__attribute__(__adlint__any)": ""
180
+ # The token sequence consists of `__attribute__', `(', any kind of tokens,
181
+ # `)' will be replaced with nothing (erased) after the preprocessing phase.
182
+ # And this substitution will be warned by the message W0061.
183
+ extension_substitution:
184
+ "__extension__": ""
185
+ "__attribute__(__adlint__any)": ""
186
+ "__asm__ __adlint__any(__adlint__any)": ""
187
+ "__signed__": "signed"
188
+ "__const": "const"
189
+ "__volatile": "volatile"
190
+ "__restrict": "restrict"
191
+ "__inline__": "inline"
192
+ "__inline": "inline"
193
+
194
+ # Token substitution setting to silently ignore the use of compiler specific
195
+ # extensions.
196
+ #
197
+ # If your compiler supports `__asm__ volatile (...)' extension and you do not
198
+ # mind the use of this extension, specify as below.
199
+ # arbitrary_substitution:
200
+ # "__asm__ __adlint__any(__adlint__any)": ""
201
+ # The token sequence consists of `__asm__', any kind of tokens, `(', any kind
202
+ # of tokens, `)' will be replaced with nothing (erased) silently after the
203
+ # preprocessing phase.
204
+ arbitrary_substitution:
205
+ "typeof": "__typeof__"
206
+ "__typeof": "__typeof__"
207
+ "alignof": "__alignof__"
208
+ "__alignof": "__alignof__"
209
+
210
+ # Max length of all symbols can be identified by the compiler.
211
+ identifier_max: 128
212
+
213
+ #
214
+ # Linker specific traits section
215
+ #
216
+ linker_traits:
217
+
218
+ # Max length of external symbols can be identified by the linker.
219
+ identifier_max: 128
220
+
221
+ # Are external symbols identified without case by the linker?
222
+ identifier_ignore_case: false
223
+
224
+ #
225
+ # Message traits section
226
+ #
227
+ message_traits:
228
+
229
+ # Language of the message text.
230
+ # Currently, "en_US" and "ja_JP" are supported.
231
+ # Please help to translate the message catalog into your language.
232
+ language: "<%= lang %>"
233
+
234
+ # Output messages with category and severity information?
235
+ message_with_class: false
236
+
237
+ # Warn only files in the specified directory. If omitted, all files (such as
238
+ # system headers or 3rd-party library headers) will be warned.
239
+ warn_only_files_in: "<%= vpath %>"
240
+
241
+ # Enable translation-unit specific code check selection?
242
+ individual_selection: true
243
+
244
+ # Project-wide code check exclusion settings.
245
+ # Ex.
246
+ # exclusion:
247
+ # categories:
248
+ # - "REL"
249
+ # - "PRT"
250
+ # severities: "[ABC][5-9][0-9]"
251
+ # messages:
252
+ # W0001: "c_builtin"
253
+ # W0002: "c_ansi"
254
+ exclusion:
255
+
256
+ # Project-wide code check inclusion settings.
257
+ # Ex.
258
+ # inclusion:
259
+ # messages:
260
+ # W0001: "c_builtin"
261
+ # W0002: "c_ansi"
262
+ inclusion:
263
+
264
+ # Message text replacement.
265
+ # Ex.
266
+ # change_list:
267
+ # W9999:
268
+ # package: "c_builtin"
269
+ # classes:
270
+ # - "REL:A10"
271
+ # - "PRT:B20"
272
+ # format: "Your custom message for the warning of W9999."
273
+ # X9999:
274
+ # package: "core"
275
+ # classes:
276
+ # - "ERR:X99"
277
+ # format: "Your custom message for the warning of X9999."
278
+ # E9999:
279
+ # package: "core"
280
+ # classes:
281
+ # - "ERR:X99"
282
+ # format: "Your custom message for the warning of E9999."
283
+ change_list:
284
+
@@ -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.0"
52
+ version: "2.0.2"
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.0"
52
+ version: "2.0.2"
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.0"
52
+ version: "2.0.2"
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.0"
52
+ version: "2.0.2"
53
53
 
54
54
  message_definition:
55
55
  X0001:
@@ -81,19 +81,42 @@ module Cpp #:nodoc:
81
81
  def skip_group
82
82
  group_depth = 1
83
83
  until @content.empty?
84
+ scan_until_next_directive_or_comment(@content)
85
+
84
86
  case
87
+ when @content.check(/\/\*|\/\//)
88
+ discard_heading_comments
85
89
  when @content.check(/[ \t]*#[ \t]*(?:if|ifdef|ifndef|asm)\b/)
86
90
  group_depth += 1
87
- @content.scan(/.*\n/)
91
+ @content.scan(/.*?\n/)
88
92
  when @content.check(/[ \t]*#[ \t]*(?:else|elif)\b/)
89
93
  return true if group_depth == 1
90
- @content.scan(/.*\n/)
94
+ @content.scan(/.*?\n/)
91
95
  when @content.check(/[ \t]*#[ \t]*(?:endif|endasm)\b/)
92
96
  group_depth -= 1
93
97
  return true if group_depth == 0
94
- @content.scan(/.*\n/)
98
+ @content.scan(/.*?\n/)
99
+ end
100
+ end
101
+ false
102
+ end
103
+
104
+ def discard_heading_comments
105
+ case
106
+ when @content.check(/\/\*/)
107
+ location = @content.location
108
+ comment = scan_block_comment(@content)
109
+ unless comment.empty?
110
+ notify_block_comment_found(comment, location)
111
+ return true
112
+ end
113
+ when @content.check(/\/\//)
114
+ location = @content.location
115
+ comment = scan_line_comment(@content)
116
+ unless comment.empty?
117
+ notify_line_comment_found(comment, location)
118
+ return true
95
119
  end
96
- break unless scan_until_next_directive(@content)
97
120
  end
98
121
  false
99
122
  end
@@ -130,49 +153,13 @@ module Cpp #:nodoc:
130
153
  on_illformed_newline_escape_found.invoke(location)
131
154
  end
132
155
 
156
+ private
133
157
  GROUP_DIRECTIVE_RE =
134
- /.*?(?=^[ \t]*#[ \t]*(?:if|ifdef|ifndef|asm|else|elif|endif|endasm)\b)/m
158
+ /^[ \t]*#[ \t]*(?:if|ifdef|ifndef|asm|else|elif|endif|endasm)\b/
135
159
  private_constant :GROUP_DIRECTIVE_RE
136
160
 
137
- private
138
- def scan_until_next_directive(content)
139
- content.scan(GROUP_DIRECTIVE_RE)
140
- end
141
- end
142
-
143
- class LexerState
144
- def initialize(lexer)
145
- @lexer = lexer
146
- end
147
-
148
- def next_token
149
- subclass_responsibility
150
- end
151
-
152
- private
153
- def discard_heading_comments
154
- discarded = false
155
- until @lexer.content.empty?
156
- case
157
- when @lexer.content.check(/\/\*/)
158
- location = @lexer.content.location
159
- comment = scan_block_comment(@lexer.content)
160
- unless comment.empty?
161
- @lexer.notify_block_comment_found(comment, location)
162
- discarded = true
163
- end
164
- when @lexer.content.check(/\/\//)
165
- location = @lexer.content.location
166
- comment = scan_line_comment(@lexer.content)
167
- unless comment.empty?
168
- @lexer.notify_line_comment_found(comment, location)
169
- discarded = true
170
- end
171
- else
172
- break
173
- end
174
- end
175
- discarded
161
+ def scan_until_next_directive_or_comment(content)
162
+ content.scan(/.*?(?=#{GROUP_DIRECTIVE_RE}|\/\*|\/\/)/m)
176
163
  end
177
164
 
178
165
  def scan_block_comment(content)
@@ -184,7 +171,7 @@ module Cpp #:nodoc:
184
171
  when content.scan(/\/\*/)
185
172
  block_depth += 1
186
173
  result += "/*"
187
- @lexer.notify_nested_block_comment_found(location) if block_depth > 1
174
+ notify_nested_block_comment_found(location) if block_depth > 1
188
175
  when content.scan(/\*\//)
189
176
  result += "*/"
190
177
  break
@@ -193,7 +180,7 @@ module Cpp #:nodoc:
193
180
  if comment = content.scan(/.*?(?=\/\*|\*\/)/m)
194
181
  result += comment
195
182
  else
196
- @lexer.notify_unterminated_block_comment(location)
183
+ notify_unterminated_block_comment(location)
197
184
  end
198
185
  end
199
186
  end
@@ -203,6 +190,21 @@ module Cpp #:nodoc:
203
190
  def scan_line_comment(content)
204
191
  content.scan(/\/\/.*?(?=\n)/)
205
192
  end
193
+ end
194
+
195
+ class LexerState
196
+ def initialize(lexer)
197
+ @lexer = lexer
198
+ end
199
+
200
+ def next_token
201
+ subclass_responsibility
202
+ end
203
+
204
+ private
205
+ def discard_heading_comments
206
+ @lexer.discard_heading_comments
207
+ end
206
208
 
207
209
  def scan_escaped_newline(content)
208
210
  location = content.location
data/lib/adlint/lexer.rb CHANGED
@@ -141,6 +141,10 @@ module AdLint #:nodoc:
141
141
  @scanner.eos?
142
142
  end
143
143
 
144
+ def _debug_inspect
145
+ @scanner.rest
146
+ end
147
+
144
148
  private
145
149
  def update_location(token)
146
150
  if (nl_count = token.count("\n")) > 0
@@ -33,8 +33,8 @@ module AdLint #:nodoc:
33
33
 
34
34
  MAJOR_VERSION = 2
35
35
  MINOR_VERSION = 0
36
- PATCH_VERSION = 0
37
- RELEASE_DATE = "2012-08-22"
36
+ PATCH_VERSION = 2
37
+ RELEASE_DATE = "2012-08-28"
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.0 開発者ガイド</title>
3
+ <title>AdLint 2.0.2 開発者ガイド</title>
4
4
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
5
- <meta name="description" content="AdLint 2.0.0 開発者ガイド">
5
+ <meta name="description" content="AdLint 2.0.2 開発者ガイド">
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.0 開発者ガイド</h1>
47
+ <h1 class="settitle">AdLint 2.0.2 開発者ガイド</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.0 開発者ガイド
5
+ @settitle AdLint 2.0.2 開発者ガイド
6
6
 
7
7
  @copying
8
8
  Copyright (C) 2010-2012, OGIS-RI Co.,Ltd.
@@ -1,8 +1,8 @@
1
1
  <html lang="en">
2
2
  <head>
3
- <title>AdLint 2.0.0 User's Guide</title>
3
+ <title>AdLint 2.0.2 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.0 User's Guide">
5
+ <meta name="description" content="AdLint 2.0.2 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.0 User's Guide</h1>
47
+ <h1 class="settitle">AdLint 2.0.2 User's Guide</h1>
48
48
  <div class="node">
49
49
  <a name="Top"></a>
50
50
  <p><hr>
@@ -462,6 +462,7 @@ In this session, GCC 4.5.1 on GNU/Linux i686 architecture is using.So select <c
462
462
  i686-linux-gcc_4.5.1
463
463
  i686-cygwin-gcc_4.3.4
464
464
  i686-mingw-gcc_4.5.2
465
+ x86_64-ubuntu_12.04-gcc_4.6.3
465
466
  </pre>
466
467
 
467
468
  <p>Generate file template which required static analysis by using <a href="#AdLintize-Command"><samp><span class="command">adlintize</span></samp></a> command.
@@ -631,6 +632,7 @@ To specify the preset build environment, more information can set automatically
631
632
  i686-linux-gcc_4.5.1
632
633
  i686-cygwin-gcc_4.3.4
633
634
  i686-mingw-gcc_4.5.2
635
+ x86_64-ubuntu_12.04-gcc_4.6.3
634
636
  </pre>
635
637
 
636
638
  <p><samp><span class="option">-e</span></samp> option can set the preset build environment.
@@ -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.0 User's Guide
5
+ @settitle AdLint 2.0.2 User's Guide
6
6
 
7
7
  @copying
8
8
  Copyright (C) 2010-2012, OGIS-RI Co.,Ltd.
@@ -376,6 +376,7 @@ In this session, GCC 4.5.1 on GNU/Linux i686 architecture is using.So select @c
376
376
  i686-linux-gcc_4.5.1
377
377
  i686-cygwin-gcc_4.3.4
378
378
  i686-mingw-gcc_4.5.2
379
+ x86_64-ubuntu_12.04-gcc_4.6.3
379
380
  @end verbatim
380
381
 
381
382
  Generate file template which required static analysis by using @ref{AdLintize Command, @command{adlintize}} command.
@@ -531,6 +532,7 @@ To specify the preset build environment, more information can set automatically
531
532
  i686-linux-gcc_4.5.1
532
533
  i686-cygwin-gcc_4.3.4
533
534
  i686-mingw-gcc_4.5.2
535
+ x86_64-ubuntu_12.04-gcc_4.6.3
534
536
  @end verbatim
535
537
 
536
538
  @option{-e} option can set the preset build environment.
@@ -1,8 +1,8 @@
1
1
  <html lang="ja">
2
2
  <head>
3
- <title>AdLint 2.0.0 利用者ガイド</title>
3
+ <title>AdLint 2.0.2 利用者ガイド</title>
4
4
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
5
- <meta name="description" content="AdLint 2.0.0 利用者ガイド">
5
+ <meta name="description" content="AdLint 2.0.2 利用者ガイド">
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.0 利用者ガイド</h1>
47
+ <h1 class="settitle">AdLint 2.0.2 利用者ガイド</h1>
48
48
  <div class="node">
49
49
  <a name="Top"></a>
50
50
  <p><hr>
@@ -468,6 +468,7 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
468
468
  i686-linux-gcc_4.5.1
469
469
  i686-cygwin-gcc_4.3.4
470
470
  i686-mingw-gcc_4.5.2
471
+ x86_64-ubuntu_12.04-gcc_4.6.3
471
472
  </pre>
472
473
 
473
474
  <p><a href="#AdLintize-Command"><samp><span class="command">adlintize</span></samp></a> コマンドで静的解析に必要なファイル
@@ -650,6 +651,7 @@ adlint_all.bat adlint_cinit.h adlint_pinit.h
650
651
  i686-linux-gcc_4.5.1
651
652
  i686-cygwin-gcc_4.3.4
652
653
  i686-mingw-gcc_4.5.2
654
+ x86_64-ubuntu_12.04-gcc_4.6.3
653
655
  </pre>
654
656
 
655
657
  <p>プリセットのビルド環境は、<samp><span class="option">-e</span></samp> オプションで指定します。
@@ -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.0 利用者ガイド
5
+ @settitle AdLint 2.0.2 利用者ガイド
6
6
 
7
7
  @copying
8
8
  Copyright (C) 2010-2012, OGIS-RI Co.,Ltd.
@@ -383,6 +383,7 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
383
383
  i686-linux-gcc_4.5.1
384
384
  i686-cygwin-gcc_4.3.4
385
385
  i686-mingw-gcc_4.5.2
386
+ x86_64-ubuntu_12.04-gcc_4.6.3
386
387
  @end verbatim
387
388
 
388
389
  @ref{AdLintize Command, @command{adlintize}} コマンドで静的解析に必要なファイル
@@ -550,6 +551,7 @@ adlint_all.bat adlint_cinit.h adlint_pinit.h
550
551
  i686-linux-gcc_4.5.1
551
552
  i686-cygwin-gcc_4.3.4
552
553
  i686-mingw-gcc_4.5.2
554
+ x86_64-ubuntu_12.04-gcc_4.6.3
553
555
  @end verbatim
554
556
 
555
557
  プリセットのビルド環境は、@option{-e} オプションで指定します。
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.0
4
+ version: 2.0.2
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-22 00:00:00.000000000 Z
12
+ date: 2012-08-28 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: ! 'AdLint is a source code static analyzer.
15
15
 
@@ -59,6 +59,8 @@ files:
59
59
  - etc/conf.d/noarch/adlint_all_bat.erb
60
60
  - etc/conf.d/noarch/adlint_all_sh.erb
61
61
  - etc/conf.d/noarch/pinit.erb
62
+ - etc/conf.d/x86_64-ubuntu_12.04/cinit-gcc_4.6.3.erb
63
+ - etc/conf.d/x86_64-ubuntu_12.04/traits-gcc_4.6.3.erb
62
64
  - etc/mesg.d/c_builtin/en_US/messages.yml
63
65
  - etc/mesg.d/c_builtin/ja_JP/messages.yml
64
66
  - etc/mesg.d/core/en_US/messages.yml
@@ -820,7 +822,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
820
822
  version: '0'
821
823
  requirements: []
822
824
  rubyforge_project:
823
- rubygems_version: 1.8.23
825
+ rubygems_version: 1.8.24
824
826
  signing_key:
825
827
  specification_version: 3
826
828
  summary: ! 'AdLint :: Advanced Lint - An open source and free source code static analyzer'