adlint 2.6.12 → 2.6.14
Sign up to get free protection for your applications and to get access to all the features.
- data/ChangeLog +77 -0
- data/NEWS +17 -4
- data/bin/adlint +24 -30
- data/bin/adlint_chk +22 -28
- data/bin/adlint_cma +20 -26
- data/bin/adlint_sma +22 -28
- data/bin/adlintize +60 -58
- data/etc/mesg.d/c_builtin/en_US/messages.yml +168 -168
- data/etc/mesg.d/c_builtin/ja_JP/messages.yml +168 -168
- 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/W0119.feature +0 -5
- data/features/code_check/W0120.feature +1 -0
- data/features/code_check/W0121.feature +0 -5
- data/features/code_check/W0123.feature +0 -5
- data/features/code_check/W0125.feature +0 -5
- data/features/code_check/W0127.feature +0 -5
- data/features/code_check/W0128.feature +0 -5
- data/features/code_check/W0129.feature +0 -5
- data/features/code_check/W0130.feature +0 -5
- data/features/code_check/W0132.feature +1 -0
- data/features/code_check/W0133.feature +0 -5
- data/features/code_check/W0134.feature +0 -5
- data/features/code_check/W0135.feature +0 -5
- data/features/code_check/W0136.feature +0 -5
- data/features/code_check/W0137.feature +0 -5
- data/features/code_check/W0138.feature +0 -5
- data/features/code_check/W0139.feature +0 -5
- data/features/code_check/W0140.feature +0 -5
- data/features/code_check/W0141.feature +0 -5
- data/features/code_check/W0142.feature +0 -5
- data/features/code_check/W0157.feature +0 -5
- data/features/code_check/W0161.feature +0 -5
- data/features/code_check/W0165.feature +0 -5
- data/features/code_check/W0169.feature +0 -5
- data/features/code_check/W0177.feature +0 -5
- data/features/code_check/W0182.feature +0 -5
- data/features/code_check/W0183.feature +0 -5
- data/features/code_check/W0184.feature +0 -5
- data/features/code_check/W0212.feature +0 -5
- data/features/code_check/W0214.feature +0 -5
- data/features/code_check/W0221.feature +0 -5
- data/features/code_check/W0223.feature +0 -5
- data/features/code_check/W0230.feature +0 -5
- data/features/code_check/W0232.feature +0 -5
- data/features/code_check/W0245.feature +0 -5
- data/features/code_check/W0246.feature +0 -5
- data/features/code_check/W0247.feature +0 -5
- data/features/code_check/W0251.feature +0 -5
- data/features/code_check/W0650.feature +0 -4
- data/features/code_check/W0703.feature +5 -1
- data/features/code_check/W0719.feature +0 -10
- data/features/code_check/W0748.feature +0 -5
- data/features/code_check/W0751.feature +0 -5
- data/features/code_check/W0756.feature +0 -5
- data/features/code_check/W0763.feature +0 -5
- data/features/code_check/W0787.feature +7 -0
- data/features/code_check/W0794.feature +0 -1
- data/features/code_check/W1052.feature +0 -2
- data/features/support/env.rb +2 -7
- data/lib/adlint/c/syntax.rb +10 -16
- data/lib/adlint/cpp/macro.rb +96 -0
- data/lib/adlint/exam/c_builtin/c_check.rb +954 -817
- data/lib/adlint/exam/c_builtin/c_check_shima.rb +17 -19
- data/lib/adlint/exam/c_builtin/ld_check.rb +86 -44
- data/lib/adlint/message.rb +1 -1
- data/lib/adlint/util.rb +8 -8
- data/lib/adlint/version.rb +2 -2
- data/lib/adlint.rb +8 -0
- 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 +5055 -5053
- data/share/doc/users_guide_en.texi +3817 -3818
- data/share/doc/users_guide_ja.html +3787 -3786
- data/share/doc/users_guide_ja.texi +3784 -3783
- data/spec/spec_helper.rb +3 -11
- metadata +2 -2
@@ -16,7 +16,6 @@ Feature: W0719
|
|
16
16
|
| mesg | line | column |
|
17
17
|
| W0117 | 1 | 5 |
|
18
18
|
| W0123 | 3 | 12 |
|
19
|
-
| W0246 | 3 | 12 |
|
20
19
|
| W0116 | 3 | 14 |
|
21
20
|
| W0719 | 3 | 14 |
|
22
21
|
| W0104 | 1 | 14 |
|
@@ -35,7 +34,6 @@ Feature: W0719
|
|
35
34
|
| mesg | line | column |
|
36
35
|
| W0117 | 1 | 5 |
|
37
36
|
| W0123 | 3 | 12 |
|
38
|
-
| W0246 | 3 | 12 |
|
39
37
|
| W0719 | 3 | 14 |
|
40
38
|
| W0104 | 1 | 14 |
|
41
39
|
| W0628 | 1 | 5 |
|
@@ -53,7 +51,6 @@ Feature: W0719
|
|
53
51
|
| mesg | line | column |
|
54
52
|
| W0117 | 1 | 5 |
|
55
53
|
| W0123 | 3 | 12 |
|
56
|
-
| W0246 | 3 | 12 |
|
57
54
|
| W0116 | 3 | 14 |
|
58
55
|
| W0104 | 1 | 14 |
|
59
56
|
| W0628 | 1 | 5 |
|
@@ -71,7 +68,6 @@ Feature: W0719
|
|
71
68
|
| mesg | line | column |
|
72
69
|
| W0117 | 1 | 5 |
|
73
70
|
| W0123 | 3 | 12 |
|
74
|
-
| W0246 | 3 | 12 |
|
75
71
|
| W0104 | 1 | 14 |
|
76
72
|
| W0628 | 1 | 5 |
|
77
73
|
|
@@ -88,11 +84,9 @@ Feature: W0719
|
|
88
84
|
| mesg | line | column |
|
89
85
|
| W0117 | 1 | 6 |
|
90
86
|
| W0123 | 3 | 5 |
|
91
|
-
| W0246 | 3 | 5 |
|
92
87
|
| W0116 | 3 | 7 |
|
93
88
|
| W0719 | 3 | 7 |
|
94
89
|
| W0136 | 3 | 5 |
|
95
|
-
| W0165 | 3 | 5 |
|
96
90
|
| W0628 | 1 | 6 |
|
97
91
|
|
98
92
|
Scenario: 31-bit right shift-expression of `char' value
|
@@ -108,7 +102,6 @@ Feature: W0719
|
|
108
102
|
| mesg | line | column |
|
109
103
|
| W0117 | 1 | 5 |
|
110
104
|
| W0123 | 3 | 12 |
|
111
|
-
| W0246 | 3 | 12 |
|
112
105
|
| W0719 | 3 | 14 |
|
113
106
|
| W0104 | 1 | 14 |
|
114
107
|
| W0628 | 1 | 5 |
|
@@ -126,11 +119,9 @@ Feature: W0719
|
|
126
119
|
| mesg | line | column |
|
127
120
|
| W0117 | 1 | 6 |
|
128
121
|
| W0123 | 3 | 5 |
|
129
|
-
| W0246 | 3 | 5 |
|
130
122
|
| W0116 | 3 | 7 |
|
131
123
|
| W0650 | 3 | 7 |
|
132
124
|
| W0136 | 3 | 5 |
|
133
|
-
| W0165 | 3 | 5 |
|
134
125
|
| W0628 | 1 | 6 |
|
135
126
|
|
136
127
|
Scenario: 63-bit right shift-expression of `char' value
|
@@ -146,7 +137,6 @@ Feature: W0719
|
|
146
137
|
| mesg | line | column |
|
147
138
|
| W0117 | 1 | 5 |
|
148
139
|
| W0123 | 3 | 12 |
|
149
|
-
| W0246 | 3 | 12 |
|
150
140
|
| W0650 | 3 | 14 |
|
151
141
|
| W0104 | 1 | 14 |
|
152
142
|
| W0628 | 1 | 5 |
|
@@ -15,7 +15,6 @@ Feature: W0748
|
|
15
15
|
Then the output should exactly match with:
|
16
16
|
| mesg | line | column |
|
17
17
|
| W0117 | 1 | 6 |
|
18
|
-
| W0135 | 3 | 23 |
|
19
18
|
| W0748 | 3 | 23 |
|
20
19
|
| W0100 | 3 | 19 |
|
21
20
|
| W0104 | 1 | 25 |
|
@@ -50,7 +49,6 @@ Feature: W0748
|
|
50
49
|
Then the output should exactly match with:
|
51
50
|
| mesg | line | column |
|
52
51
|
| W0117 | 1 | 6 |
|
53
|
-
| W0135 | 4 | 9 |
|
54
52
|
| W0748 | 4 | 9 |
|
55
53
|
| W0100 | 3 | 19 |
|
56
54
|
| W0104 | 1 | 25 |
|
@@ -88,7 +86,6 @@ Feature: W0748
|
|
88
86
|
| mesg | line | column |
|
89
87
|
| W0118 | 1 | 13 |
|
90
88
|
| W0117 | 3 | 6 |
|
91
|
-
| W0135 | 5 | 9 |
|
92
89
|
| W0748 | 5 | 9 |
|
93
90
|
| W0104 | 3 | 25 |
|
94
91
|
| W0628 | 3 | 6 |
|
@@ -123,9 +120,7 @@ Feature: W0748
|
|
123
120
|
Then the output should exactly match with:
|
124
121
|
| mesg | line | column |
|
125
122
|
| W0117 | 1 | 15 |
|
126
|
-
| W0135 | 3 | 12 |
|
127
123
|
| W0748 | 3 | 12 |
|
128
|
-
| W0271 | 3 | 5 |
|
129
124
|
| W0382 | 3 | 5 |
|
130
125
|
| W0104 | 1 | 34 |
|
131
126
|
| W0628 | 1 | 15 |
|
@@ -15,7 +15,6 @@ Feature: W0751
|
|
15
15
|
Then the output should exactly match with:
|
16
16
|
| mesg | line | column |
|
17
17
|
| W0117 | 1 | 6 |
|
18
|
-
| W0137 | 3 | 23 |
|
19
18
|
| W0751 | 3 | 23 |
|
20
19
|
| W0100 | 3 | 19 |
|
21
20
|
| W0104 | 1 | 23 |
|
@@ -50,7 +49,6 @@ Feature: W0751
|
|
50
49
|
Then the output should exactly match with:
|
51
50
|
| mesg | line | column |
|
52
51
|
| W0117 | 1 | 6 |
|
53
|
-
| W0137 | 4 | 9 |
|
54
52
|
| W0751 | 4 | 9 |
|
55
53
|
| W0100 | 3 | 19 |
|
56
54
|
| W0104 | 1 | 23 |
|
@@ -88,7 +86,6 @@ Feature: W0751
|
|
88
86
|
| mesg | line | column |
|
89
87
|
| W0118 | 1 | 13 |
|
90
88
|
| W0117 | 3 | 6 |
|
91
|
-
| W0137 | 5 | 9 |
|
92
89
|
| W0751 | 5 | 9 |
|
93
90
|
| W0104 | 3 | 23 |
|
94
91
|
| W0628 | 3 | 6 |
|
@@ -123,9 +120,7 @@ Feature: W0751
|
|
123
120
|
Then the output should exactly match with:
|
124
121
|
| mesg | line | column |
|
125
122
|
| W0117 | 1 | 15 |
|
126
|
-
| W0137 | 3 | 12 |
|
127
123
|
| W0751 | 3 | 12 |
|
128
|
-
| W0273 | 3 | 5 |
|
129
124
|
| W0385 | 3 | 5 |
|
130
125
|
| W0104 | 1 | 32 |
|
131
126
|
| W0628 | 1 | 15 |
|
@@ -15,7 +15,6 @@ Feature: W0756
|
|
15
15
|
Then the output should exactly match with:
|
16
16
|
| mesg | line | column |
|
17
17
|
| W0117 | 1 | 6 |
|
18
|
-
| W0139 | 3 | 23 |
|
19
18
|
| W0756 | 3 | 23 |
|
20
19
|
| W0100 | 3 | 19 |
|
21
20
|
| W0104 | 1 | 24 |
|
@@ -50,7 +49,6 @@ Feature: W0756
|
|
50
49
|
Then the output should exactly match with:
|
51
50
|
| mesg | line | column |
|
52
51
|
| W0117 | 1 | 6 |
|
53
|
-
| W0139 | 4 | 9 |
|
54
52
|
| W0756 | 4 | 9 |
|
55
53
|
| W0100 | 3 | 19 |
|
56
54
|
| W0104 | 1 | 24 |
|
@@ -88,7 +86,6 @@ Feature: W0756
|
|
88
86
|
| mesg | line | column |
|
89
87
|
| W0118 | 1 | 13 |
|
90
88
|
| W0117 | 3 | 6 |
|
91
|
-
| W0139 | 5 | 9 |
|
92
89
|
| W0756 | 5 | 9 |
|
93
90
|
| W0104 | 3 | 24 |
|
94
91
|
| W0628 | 3 | 6 |
|
@@ -123,9 +120,7 @@ Feature: W0756
|
|
123
120
|
Then the output should exactly match with:
|
124
121
|
| mesg | line | column |
|
125
122
|
| W0117 | 1 | 15 |
|
126
|
-
| W0139 | 3 | 12 |
|
127
123
|
| W0756 | 3 | 12 |
|
128
|
-
| W0275 | 3 | 5 |
|
129
124
|
| W0390 | 3 | 5 |
|
130
125
|
| W0104 | 1 | 33 |
|
131
126
|
| W0628 | 1 | 15 |
|
@@ -15,7 +15,6 @@ Feature: W0763
|
|
15
15
|
Then the output should exactly match with:
|
16
16
|
| mesg | line | column |
|
17
17
|
| W0117 | 1 | 6 |
|
18
|
-
| W0141 | 3 | 23 |
|
19
18
|
| W0763 | 3 | 23 |
|
20
19
|
| W0100 | 3 | 19 |
|
21
20
|
| W0104 | 1 | 29 |
|
@@ -52,7 +51,6 @@ Feature: W0763
|
|
52
51
|
Then the output should exactly match with:
|
53
52
|
| mesg | line | column |
|
54
53
|
| W0117 | 1 | 6 |
|
55
|
-
| W0141 | 4 | 9 |
|
56
54
|
| W0763 | 4 | 9 |
|
57
55
|
| W0100 | 3 | 19 |
|
58
56
|
| W0104 | 1 | 29 |
|
@@ -92,7 +90,6 @@ Feature: W0763
|
|
92
90
|
| mesg | line | column |
|
93
91
|
| W0118 | 1 | 13 |
|
94
92
|
| W0117 | 3 | 6 |
|
95
|
-
| W0141 | 5 | 9 |
|
96
93
|
| W0763 | 5 | 9 |
|
97
94
|
| W0104 | 3 | 29 |
|
98
95
|
| W0834 | 3 | 10 |
|
@@ -129,9 +126,7 @@ Feature: W0763
|
|
129
126
|
Then the output should exactly match with:
|
130
127
|
| mesg | line | column |
|
131
128
|
| W0117 | 1 | 15 |
|
132
|
-
| W0141 | 3 | 12 |
|
133
129
|
| W0763 | 3 | 12 |
|
134
|
-
| W0277 | 3 | 5 |
|
135
130
|
| W0397 | 3 | 5 |
|
136
131
|
| W0104 | 1 | 38 |
|
137
132
|
| W0834 | 1 | 19 |
|
@@ -53,7 +53,14 @@ Feature: W0787
|
|
53
53
|
| W0118 | 9 | 17 |
|
54
54
|
| W0623 | 9 | 17 |
|
55
55
|
| W0787 | 9 | 17 |
|
56
|
+
| C0001 | 3 | 16 |
|
56
57
|
| W0628 | 1 | 6 |
|
57
58
|
| W0628 | 7 | 6 |
|
59
|
+
| W0770 | 3 | 16 |
|
60
|
+
| C0001 | 9 | 17 |
|
58
61
|
| W1037 | 3 | 16 |
|
62
|
+
| C0001 | 9 | 17 |
|
63
|
+
| W0770 | 9 | 17 |
|
64
|
+
| C0001 | 3 | 16 |
|
59
65
|
| W1037 | 9 | 17 |
|
66
|
+
| C0001 | 3 | 16 |
|
data/features/support/env.rb
CHANGED
@@ -122,19 +122,14 @@ typedef unsigned long size_t;
|
|
122
122
|
#endif
|
123
123
|
EOF
|
124
124
|
|
125
|
-
require "pathname"
|
126
|
-
require "stringio"
|
127
|
-
|
128
125
|
if ENV["ADLINT_COV"] =~ /1|on|true/
|
129
126
|
require "simplecov"
|
130
127
|
require "simplecov-html"
|
131
128
|
SimpleCov.start
|
132
129
|
end
|
133
130
|
|
134
|
-
$
|
135
|
-
$
|
136
|
-
$bindir = Pathname.new("bin").expand_path($prefix)
|
137
|
-
$tmpdir = Pathname.new("cucumber-tmp").expand_path($prefix)
|
131
|
+
$bindir = File.expand_path("../../bin", File.dirname(__FILE__))
|
132
|
+
$tmpdir = File.expand_path("../../cucumber-tmp", File.dirname(__FILE__))
|
138
133
|
|
139
134
|
module Kernel
|
140
135
|
def exit(status)
|
data/lib/adlint/c/syntax.rb
CHANGED
@@ -945,7 +945,7 @@ module C #:nodoc:
|
|
945
945
|
def inspect(indent = 0)
|
946
946
|
([" " * indent + "#{short_class_name} (#{location.inspect})"] +
|
947
947
|
[@expression.inspect(indent + 1)] +
|
948
|
-
|
948
|
+
@argument_expressions.map { |a| a.inspect(indent + 1) }).join("\n")
|
949
949
|
end
|
950
950
|
end
|
951
951
|
|
@@ -1285,7 +1285,7 @@ module C #:nodoc:
|
|
1285
1285
|
|
1286
1286
|
def inspect(indent = 0)
|
1287
1287
|
" " * indent + "#{short_class_name} (#{location.inspect}) " +
|
1288
|
-
|
1288
|
+
@initializers.map { |init| init.inspect }.join(",")
|
1289
1289
|
end
|
1290
1290
|
end
|
1291
1291
|
|
@@ -2581,7 +2581,7 @@ module C #:nodoc:
|
|
2581
2581
|
def inspect(indent = 0)
|
2582
2582
|
" " * indent + "#{short_class_name} (#{location.inspect}) " +
|
2583
2583
|
"#{identifier.value}\n" +
|
2584
|
-
|
2584
|
+
@struct_declarations.map { |sd| sd.inspect(indent + 1) }.join("\n")
|
2585
2585
|
end
|
2586
2586
|
end
|
2587
2587
|
|
@@ -2616,7 +2616,7 @@ module C #:nodoc:
|
|
2616
2616
|
def inspect(indent = 0)
|
2617
2617
|
" " * indent + "#{short_class_name} (#{location.inspect}) " +
|
2618
2618
|
"#{identifier.value}\n" +
|
2619
|
-
|
2619
|
+
@struct_declarations.map { |sd| sd.inspect(indent + 1) }.join("\n")
|
2620
2620
|
end
|
2621
2621
|
end
|
2622
2622
|
|
@@ -2787,8 +2787,7 @@ module C #:nodoc:
|
|
2787
2787
|
"struct #{identifier.value} {}"
|
2788
2788
|
else
|
2789
2789
|
"struct #{identifier.value} { " +
|
2790
|
-
@struct_declarations.map { |decl| decl.to_s }.join(" ") +
|
2791
|
-
" }"
|
2790
|
+
@struct_declarations.map { |decl| decl.to_s }.join(" ") + " }"
|
2792
2791
|
end
|
2793
2792
|
else
|
2794
2793
|
"struct #{identifier.value}"
|
@@ -3413,8 +3412,7 @@ module C #:nodoc:
|
|
3413
3412
|
|
3414
3413
|
def inspect(indent = 0)
|
3415
3414
|
" " * indent + "#{short_class_name}\n" +
|
3416
|
-
@expression.inspect(indent + 1) + "\n" +
|
3417
|
-
@statement.inspect(indent + 1)
|
3415
|
+
@expression.inspect(indent + 1) + "\n" + @statement.inspect(indent + 1)
|
3418
3416
|
end
|
3419
3417
|
end
|
3420
3418
|
|
@@ -3492,8 +3490,7 @@ module C #:nodoc:
|
|
3492
3490
|
|
3493
3491
|
def inspect(indent = 0)
|
3494
3492
|
" " * indent + "#{short_class_name}\n" +
|
3495
|
-
@expression.inspect(indent + 1) + "\n" +
|
3496
|
-
@statement.inspect(indent + 1)
|
3493
|
+
@expression.inspect(indent + 1) + "\n" + @statement.inspect(indent + 1)
|
3497
3494
|
end
|
3498
3495
|
end
|
3499
3496
|
|
@@ -3543,8 +3540,7 @@ module C #:nodoc:
|
|
3543
3540
|
|
3544
3541
|
def inspect(indent = 0)
|
3545
3542
|
" " * indent + "#{short_class_name}\n" +
|
3546
|
-
@expression.inspect(indent + 1) + "\n" +
|
3547
|
-
@statement.inspect(indent + 1)
|
3543
|
+
@expression.inspect(indent + 1) + "\n" + @statement.inspect(indent + 1)
|
3548
3544
|
end
|
3549
3545
|
|
3550
3546
|
private
|
@@ -3752,8 +3748,7 @@ module C #:nodoc:
|
|
3752
3748
|
|
3753
3749
|
def inspect(indent = 0)
|
3754
3750
|
" " * indent + "#{short_class_name}\n" +
|
3755
|
-
@expression.inspect(indent + 1) + "\n" +
|
3756
|
-
@statement.inspect(indent + 1)
|
3751
|
+
@expression.inspect(indent + 1) + "\n" + @statement.inspect(indent + 1)
|
3757
3752
|
end
|
3758
3753
|
end
|
3759
3754
|
|
@@ -3794,8 +3789,7 @@ module C #:nodoc:
|
|
3794
3789
|
|
3795
3790
|
def inspect(indent = 0)
|
3796
3791
|
" " * indent + "#{short_class_name}\n" +
|
3797
|
-
@statement.inspect(indent + 1) + "\n" +
|
3798
|
-
@expression.inspect(indent + 1)
|
3792
|
+
@statement.inspect(indent + 1) + "\n" + @expression.inspect(indent + 1)
|
3799
3793
|
end
|
3800
3794
|
end
|
3801
3795
|
|
data/lib/adlint/cpp/macro.rb
CHANGED
@@ -528,6 +528,94 @@ module Cpp #:nodoc:
|
|
528
528
|
end
|
529
529
|
end
|
530
530
|
|
531
|
+
class LintSpecificMacro1 < SpecialMacro
|
532
|
+
def initialize
|
533
|
+
super("__LINT__")
|
534
|
+
end
|
535
|
+
|
536
|
+
private
|
537
|
+
def generate_replacement_list(token)
|
538
|
+
PPTokens.new.push(Token.new(:PP_TOKEN, "1", token.location, :CONSTANT))
|
539
|
+
end
|
540
|
+
end
|
541
|
+
|
542
|
+
class LintSpecificMacro2 < SpecialMacro
|
543
|
+
def initialize
|
544
|
+
super("lint")
|
545
|
+
end
|
546
|
+
|
547
|
+
private
|
548
|
+
def generate_replacement_list(token)
|
549
|
+
PPTokens.new.push(Token.new(:PP_TOKEN, "1", token.location, :CONSTANT))
|
550
|
+
end
|
551
|
+
end
|
552
|
+
|
553
|
+
class LintSpecificMacro3 < SpecialMacro
|
554
|
+
def initialize
|
555
|
+
super("__lint")
|
556
|
+
end
|
557
|
+
|
558
|
+
private
|
559
|
+
def generate_replacement_list(token)
|
560
|
+
PPTokens.new.push(Token.new(:PP_TOKEN, "1", token.location, :CONSTANT))
|
561
|
+
end
|
562
|
+
end
|
563
|
+
|
564
|
+
class LintSpecificMacro4 < SpecialMacro
|
565
|
+
def initialize
|
566
|
+
super("__lint__")
|
567
|
+
end
|
568
|
+
|
569
|
+
private
|
570
|
+
def generate_replacement_list(token)
|
571
|
+
PPTokens.new.push(Token.new(:PP_TOKEN, "1", token.location, :CONSTANT))
|
572
|
+
end
|
573
|
+
end
|
574
|
+
|
575
|
+
class AdLintSpecificMacro1 < SpecialMacro
|
576
|
+
def initialize
|
577
|
+
super("__ADLINT__")
|
578
|
+
end
|
579
|
+
|
580
|
+
private
|
581
|
+
def generate_replacement_list(token)
|
582
|
+
PPTokens.new.push(Token.new(:PP_TOKEN, "1", token.location, :CONSTANT))
|
583
|
+
end
|
584
|
+
end
|
585
|
+
|
586
|
+
class AdLintSpecificMacro2 < SpecialMacro
|
587
|
+
def initialize
|
588
|
+
super("adlint")
|
589
|
+
end
|
590
|
+
|
591
|
+
private
|
592
|
+
def generate_replacement_list(token)
|
593
|
+
PPTokens.new.push(Token.new(:PP_TOKEN, "1", token.location, :CONSTANT))
|
594
|
+
end
|
595
|
+
end
|
596
|
+
|
597
|
+
class AdLintSpecificMacro3 < SpecialMacro
|
598
|
+
def initialize
|
599
|
+
super("__adlint")
|
600
|
+
end
|
601
|
+
|
602
|
+
private
|
603
|
+
def generate_replacement_list(token)
|
604
|
+
PPTokens.new.push(Token.new(:PP_TOKEN, "1", token.location, :CONSTANT))
|
605
|
+
end
|
606
|
+
end
|
607
|
+
|
608
|
+
class AdLintSpecificMacro4 < SpecialMacro
|
609
|
+
def initialize
|
610
|
+
super("__adlint__")
|
611
|
+
end
|
612
|
+
|
613
|
+
private
|
614
|
+
def generate_replacement_list(token)
|
615
|
+
PPTokens.new.push(Token.new(:PP_TOKEN, "1", token.location, :CONSTANT))
|
616
|
+
end
|
617
|
+
end
|
618
|
+
|
531
619
|
class MacroReplacementContext
|
532
620
|
def initialize
|
533
621
|
@hide_sets = Hash.new { |h, k| h[k] = Set.new }
|
@@ -671,6 +759,14 @@ module Cpp #:nodoc:
|
|
671
759
|
define(StdcIec559ComplexMacro.new)
|
672
760
|
define(StdcIso10646Macro.new)
|
673
761
|
define(PragmaOperator.new)
|
762
|
+
define(LintSpecificMacro1.new)
|
763
|
+
define(LintSpecificMacro2.new)
|
764
|
+
define(LintSpecificMacro3.new)
|
765
|
+
define(LintSpecificMacro4.new)
|
766
|
+
define(AdLintSpecificMacro1.new)
|
767
|
+
define(AdLintSpecificMacro2.new)
|
768
|
+
define(AdLintSpecificMacro3.new)
|
769
|
+
define(AdLintSpecificMacro4.new)
|
674
770
|
end
|
675
771
|
end
|
676
772
|
|