adlint 2.6.14 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (401) hide show
  1. data/AUTHORS +1 -3
  2. data/ChangeLog +511 -0
  3. data/INSTALL +1 -1
  4. data/MANIFEST +57 -37
  5. data/NEWS +36 -7
  6. data/README +2 -2
  7. data/Rakefile +6 -6
  8. data/TODO +1 -1
  9. data/bin/adlint +25 -16
  10. data/bin/adlint_chk +22 -12
  11. data/bin/adlint_cma +17 -12
  12. data/bin/adlint_sma +22 -12
  13. data/bin/adlintize +98 -17
  14. data/etc/conf.d/fallback/cinit.erb +1 -1
  15. data/etc/conf.d/fallback/traits.erb +37 -37
  16. data/etc/conf.d/i686-cygwin/cinit-gcc_4.3.4.erb +1 -1
  17. data/etc/conf.d/i686-cygwin/traits-gcc_4.3.4.erb +41 -41
  18. data/etc/conf.d/i686-devkit/cinit-gcc_4.5.2.erb +1 -1
  19. data/etc/conf.d/i686-devkit/traits-gcc_4.5.2.erb +40 -40
  20. data/etc/conf.d/i686-linux/cinit-gcc_4.5.1.erb +1 -1
  21. data/etc/conf.d/i686-linux/traits-gcc_4.5.1.erb +40 -40
  22. data/etc/conf.d/i686-mingw/cinit-gcc_4.6.1.erb +1 -1
  23. data/etc/conf.d/i686-mingw/traits-gcc_4.6.1.erb +40 -40
  24. data/etc/conf.d/noarch/GNUmakefile.erb +1 -1
  25. data/etc/conf.d/noarch/adlint_all_bat.erb +1 -1
  26. data/etc/conf.d/noarch/adlint_all_sh.erb +1 -1
  27. data/etc/conf.d/noarch/pinit.erb +1 -1
  28. data/etc/conf.d/x86_64-ubuntu_12.04/cinit-gcc_4.6.3.erb +1 -1
  29. data/etc/conf.d/x86_64-ubuntu_12.04/traits-gcc_4.6.3.erb +42 -42
  30. data/etc/mesg.d/c_builtin/en_US/messages.yml +33 -33
  31. data/etc/mesg.d/c_builtin/ja_JP/messages.yml +5 -5
  32. data/etc/mesg.d/core/en_US/messages.yml +2 -2
  33. data/etc/mesg.d/core/ja_JP/messages.yml +2 -2
  34. data/features/code_check/W0018.feature +197 -0
  35. data/features/code_check/W0019.feature +79 -0
  36. data/features/code_check/W0021.feature +81 -0
  37. data/features/code_check/W0023.feature +203 -0
  38. data/features/code_check/W0024.feature +226 -0
  39. data/features/code_check/W0025.feature +5 -0
  40. data/features/code_check/W0088.feature +2 -2
  41. data/features/code_check/W0109.feature +2 -2
  42. data/features/code_check/W0477.feature +0 -3
  43. data/features/code_check/W0478.feature +0 -1
  44. data/features/code_check/W0582.feature +3 -3
  45. data/features/code_check/W0583.feature +4 -7
  46. data/features/code_check/W0646.feature +0 -1
  47. data/features/code_check/W0695.feature +0 -1
  48. data/features/code_check/W0705.feature +8 -0
  49. data/features/code_check/W0723.feature +0 -1
  50. data/features/code_check/W0745.feature +1 -0
  51. data/features/code_check/W0781.feature +1 -0
  52. data/features/code_check/W1057.feature +141 -0
  53. data/features/code_check/W1058.feature +93 -0
  54. data/features/code_check/W1059.feature +86 -0
  55. data/features/code_check/W1060.feature +77 -0
  56. data/features/code_check/W1061.feature +143 -0
  57. data/features/code_check/W1062.feature +162 -0
  58. data/features/code_check/W1063.feature +123 -0
  59. data/features/code_check/W1064.feature +83 -0
  60. data/features/code_check/W1065.feature +82 -0
  61. data/features/code_check/W9003.feature +2 -0
  62. data/features/step_definitions/code_check_steps.rb +1 -0
  63. data/features/support/env.rb +16 -13
  64. data/lib/adlint.rb +7 -4
  65. data/lib/adlint/analyzer.rb +131 -157
  66. data/lib/adlint/annot.rb +149 -0
  67. data/lib/adlint/cc1.rb +57 -0
  68. data/lib/adlint/{c → cc1}/branch.rb +74 -62
  69. data/lib/adlint/{c → cc1}/builtin.rb +21 -21
  70. data/lib/adlint/{c → cc1}/const.rb +119 -117
  71. data/lib/adlint/{c → cc1}/conv.rb +76 -78
  72. data/lib/adlint/{c → cc1}/ctrlexpr.rb +69 -86
  73. data/lib/adlint/cc1/domain.rb +8103 -0
  74. data/lib/adlint/{c → cc1}/enum.rb +3 -3
  75. data/lib/adlint/{c → cc1}/environ.rb +21 -21
  76. data/lib/adlint/{c → cc1}/expr.rb +232 -218
  77. data/lib/adlint/{c → cc1}/format.rb +305 -342
  78. data/lib/adlint/{c → cc1}/interp.rb +269 -220
  79. data/lib/adlint/cc1/lexer.rb +246 -0
  80. data/lib/adlint/{c → cc1}/mediator.rb +78 -84
  81. data/lib/adlint/{c → cc1}/object.rb +261 -264
  82. data/lib/adlint/{c → cc1}/operator.rb +7 -7
  83. data/lib/adlint/{c → cc1}/option.rb +4 -3
  84. data/lib/adlint/{c → cc1}/parser.rb +274 -506
  85. data/lib/adlint/{c → cc1}/parser.y +69 -301
  86. data/lib/adlint/cc1/phase.rb +138 -0
  87. data/lib/adlint/{c → cc1}/resolver.rb +66 -78
  88. data/lib/adlint/{c → cc1}/scanner.rb +57 -49
  89. data/lib/adlint/{c → cc1}/scope.rb +3 -3
  90. data/lib/adlint/{c → cc1}/seqp.rb +13 -5
  91. data/lib/adlint/{c → cc1}/syntax.rb +819 -1122
  92. data/lib/adlint/{c → cc1}/type.rb +1498 -1479
  93. data/lib/adlint/{c → cc1}/util.rb +20 -12
  94. data/lib/adlint/{c → cc1}/value.rb +699 -642
  95. data/lib/adlint/code.rb +163 -164
  96. data/lib/adlint/cpp.rb +2 -2
  97. data/lib/adlint/cpp/asm.rb +13 -14
  98. data/lib/adlint/cpp/constexpr.rb +42 -38
  99. data/lib/adlint/cpp/constexpr.y +44 -40
  100. data/lib/adlint/cpp/eval.rb +435 -435
  101. data/lib/adlint/cpp/lexer.rb +343 -340
  102. data/lib/adlint/cpp/macro.rb +188 -190
  103. data/lib/adlint/cpp/phase.rb +66 -45
  104. data/lib/adlint/cpp/scanner.rb +14 -17
  105. data/lib/adlint/cpp/source.rb +49 -55
  106. data/lib/adlint/cpp/subst.rb +65 -65
  107. data/lib/adlint/cpp/syntax.rb +155 -275
  108. data/lib/adlint/cpp/util.rb +22 -19
  109. data/lib/adlint/driver.rb +86 -93
  110. data/lib/adlint/error.rb +33 -52
  111. data/lib/adlint/exam.rb +158 -24
  112. data/lib/adlint/exam/c_builtin.rb +7 -7
  113. data/lib/adlint/exam/c_builtin/cc1_check.rb +20522 -0
  114. data/lib/adlint/exam/c_builtin/cc1_check_shima.rb +957 -0
  115. data/lib/adlint/exam/c_builtin/cc1_code.rb +459 -0
  116. data/lib/adlint/exam/c_builtin/cc1_metric.rb +794 -0
  117. data/lib/adlint/exam/c_builtin/cpp_check.rb +486 -441
  118. data/lib/adlint/exam/c_builtin/cpp_check_shima.rb +36 -39
  119. data/lib/adlint/exam/c_builtin/cpp_code.rb +63 -65
  120. data/lib/adlint/exam/c_builtin/ld_check.rb +136 -129
  121. data/lib/adlint/exam/c_builtin/ld_metric.rb +11 -11
  122. data/lib/adlint/lang.rb +25 -25
  123. data/lib/adlint/ld.rb +2 -2
  124. data/lib/adlint/ld/object.rb +220 -188
  125. data/lib/adlint/ld/phase.rb +94 -63
  126. data/lib/adlint/ld/typedef.rb +22 -11
  127. data/lib/adlint/ld/util.rb +43 -35
  128. data/lib/adlint/lexer.rb +59 -56
  129. data/lib/adlint/location.rb +140 -0
  130. data/lib/adlint/memo.rb +157 -0
  131. data/lib/adlint/message.rb +207 -156
  132. data/lib/adlint/metric.rb +139 -217
  133. data/lib/adlint/monitor.rb +45 -43
  134. data/lib/adlint/phase.rb +56 -29
  135. data/lib/adlint/prelude.rb +66 -54
  136. data/lib/adlint/report.rb +253 -332
  137. data/lib/adlint/source.rb +26 -27
  138. data/lib/adlint/supp.rb +131 -0
  139. data/lib/adlint/symbol.rb +14 -16
  140. data/lib/adlint/token.rb +19 -91
  141. data/lib/adlint/traits.rb +242 -226
  142. data/lib/adlint/util.rb +116 -205
  143. data/lib/adlint/version.rb +8 -8
  144. data/share/HEADER +2 -2
  145. data/share/doc/developers_guide_ja.html +148 -19
  146. data/share/doc/developers_guide_ja.texi +141 -11
  147. data/share/doc/samples/GNUmakefile +1 -1
  148. data/share/doc/samples/adlint_traits.yml +45 -36
  149. data/share/doc/users_guide_en.html +1321 -1252
  150. data/share/doc/users_guide_en.texi +475 -408
  151. data/share/doc/users_guide_ja.html +1932 -1878
  152. data/share/doc/users_guide_ja.texi +324 -273
  153. data/share/sample/bison-2.5/adlint/GNUmakefile +5 -1
  154. data/share/sample/bison-2.5/adlint/adlint_traits.yml +38 -38
  155. data/share/sample/bison-2.5/adlint/lib/GNUmakefile +1 -1
  156. data/share/sample/bison-2.5/adlint/lib/adlint_cinit.h +1 -1
  157. data/share/sample/bison-2.5/adlint/lib/adlint_pinit.h +1 -1
  158. data/share/sample/bison-2.5/adlint/lib/adlint_traits.yml +50 -42
  159. data/share/sample/bison-2.5/adlint/src/GNUmakefile +1 -1
  160. data/share/sample/bison-2.5/adlint/src/adlint_cinit.h +1 -1
  161. data/share/sample/bison-2.5/adlint/src/adlint_pinit.h +1 -1
  162. data/share/sample/bison-2.5/adlint/src/adlint_traits.yml +50 -42
  163. data/share/sample/ctags-5.8/adlint/GNUmakefile +1 -1
  164. data/share/sample/ctags-5.8/adlint/adlint_cinit.h +1 -1
  165. data/share/sample/ctags-5.8/adlint/adlint_pinit.h +1 -1
  166. data/share/sample/ctags-5.8/adlint/adlint_traits.yml +50 -42
  167. data/share/sample/flex-2.5.35/adlint/GNUmakefile +1 -1
  168. data/share/sample/flex-2.5.35/adlint/adlint_cinit.h +1 -1
  169. data/share/sample/flex-2.5.35/adlint/adlint_pinit.h +1 -1
  170. data/share/sample/flex-2.5.35/adlint/adlint_traits.yml +50 -42
  171. data/share/sample/ruby-1.9.3-p0/adlint/GNUmakefile +1 -1
  172. data/share/sample/ruby-1.9.3-p0/adlint/adlint_traits.yml +46 -38
  173. data/share/sample/ruby-1.9.3-p0/adlint/core/GNUmakefile +1 -1
  174. data/share/sample/ruby-1.9.3-p0/adlint/core/adlint_cinit.h +1 -1
  175. data/share/sample/ruby-1.9.3-p0/adlint/core/adlint_pinit.h +1 -1
  176. data/share/sample/ruby-1.9.3-p0/adlint/core/adlint_traits.yml +50 -42
  177. data/share/sample/ruby-1.9.3-p0/adlint/enc-trans/GNUmakefile +1 -1
  178. data/share/sample/ruby-1.9.3-p0/adlint/enc-trans/adlint_cinit.h +1 -1
  179. data/share/sample/ruby-1.9.3-p0/adlint/enc-trans/adlint_pinit.h +1 -1
  180. data/share/sample/ruby-1.9.3-p0/adlint/enc-trans/adlint_traits.yml +50 -42
  181. data/share/sample/ruby-1.9.3-p0/adlint/enc/GNUmakefile +1 -1
  182. data/share/sample/ruby-1.9.3-p0/adlint/enc/adlint_cinit.h +1 -1
  183. data/share/sample/ruby-1.9.3-p0/adlint/enc/adlint_pinit.h +1 -1
  184. data/share/sample/ruby-1.9.3-p0/adlint/enc/adlint_traits.yml +50 -42
  185. data/share/sample/ruby-1.9.3-p0/adlint/ext-bigdecimal/GNUmakefile +1 -1
  186. data/share/sample/ruby-1.9.3-p0/adlint/ext-bigdecimal/adlint_cinit.h +1 -1
  187. data/share/sample/ruby-1.9.3-p0/adlint/ext-bigdecimal/adlint_pinit.h +1 -1
  188. data/share/sample/ruby-1.9.3-p0/adlint/ext-bigdecimal/adlint_traits.yml +50 -42
  189. data/share/sample/ruby-1.9.3-p0/adlint/ext-continuation/GNUmakefile +1 -1
  190. data/share/sample/ruby-1.9.3-p0/adlint/ext-continuation/adlint_cinit.h +1 -1
  191. data/share/sample/ruby-1.9.3-p0/adlint/ext-continuation/adlint_pinit.h +1 -1
  192. data/share/sample/ruby-1.9.3-p0/adlint/ext-continuation/adlint_traits.yml +50 -42
  193. data/share/sample/ruby-1.9.3-p0/adlint/ext-coverage/GNUmakefile +1 -1
  194. data/share/sample/ruby-1.9.3-p0/adlint/ext-coverage/adlint_cinit.h +1 -1
  195. data/share/sample/ruby-1.9.3-p0/adlint/ext-coverage/adlint_pinit.h +1 -1
  196. data/share/sample/ruby-1.9.3-p0/adlint/ext-coverage/adlint_traits.yml +50 -42
  197. data/share/sample/ruby-1.9.3-p0/adlint/ext-curses/GNUmakefile +1 -1
  198. data/share/sample/ruby-1.9.3-p0/adlint/ext-curses/adlint_cinit.h +1 -1
  199. data/share/sample/ruby-1.9.3-p0/adlint/ext-curses/adlint_pinit.h +1 -1
  200. data/share/sample/ruby-1.9.3-p0/adlint/ext-curses/adlint_traits.yml +50 -42
  201. data/share/sample/ruby-1.9.3-p0/adlint/ext-date/GNUmakefile +1 -1
  202. data/share/sample/ruby-1.9.3-p0/adlint/ext-date/adlint_cinit.h +1 -1
  203. data/share/sample/ruby-1.9.3-p0/adlint/ext-date/adlint_pinit.h +1 -1
  204. data/share/sample/ruby-1.9.3-p0/adlint/ext-date/adlint_traits.yml +50 -42
  205. data/share/sample/ruby-1.9.3-p0/adlint/ext-dbm/GNUmakefile +1 -1
  206. data/share/sample/ruby-1.9.3-p0/adlint/ext-dbm/adlint_cinit.h +1 -1
  207. data/share/sample/ruby-1.9.3-p0/adlint/ext-dbm/adlint_pinit.h +1 -1
  208. data/share/sample/ruby-1.9.3-p0/adlint/ext-dbm/adlint_traits.yml +50 -42
  209. data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-bubblebabble/GNUmakefile +1 -1
  210. data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-bubblebabble/adlint_cinit.h +1 -1
  211. data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-bubblebabble/adlint_pinit.h +1 -1
  212. data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-bubblebabble/adlint_traits.yml +50 -42
  213. data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-md5/GNUmakefile +1 -1
  214. data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-md5/adlint_cinit.h +1 -1
  215. data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-md5/adlint_pinit.h +1 -1
  216. data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-md5/adlint_traits.yml +50 -42
  217. data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-rmd160/GNUmakefile +1 -1
  218. data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-rmd160/adlint_cinit.h +1 -1
  219. data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-rmd160/adlint_pinit.h +1 -1
  220. data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-rmd160/adlint_traits.yml +50 -42
  221. data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-sha1/GNUmakefile +1 -1
  222. data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-sha1/adlint_cinit.h +1 -1
  223. data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-sha1/adlint_pinit.h +1 -1
  224. data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-sha1/adlint_traits.yml +50 -42
  225. data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-sha2/GNUmakefile +1 -1
  226. data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-sha2/adlint_cinit.h +1 -1
  227. data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-sha2/adlint_pinit.h +1 -1
  228. data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-sha2/adlint_traits.yml +50 -42
  229. data/share/sample/ruby-1.9.3-p0/adlint/ext-digest/GNUmakefile +1 -1
  230. data/share/sample/ruby-1.9.3-p0/adlint/ext-digest/adlint_cinit.h +1 -1
  231. data/share/sample/ruby-1.9.3-p0/adlint/ext-digest/adlint_pinit.h +1 -1
  232. data/share/sample/ruby-1.9.3-p0/adlint/ext-digest/adlint_traits.yml +50 -42
  233. data/share/sample/ruby-1.9.3-p0/adlint/ext-dl-callback/GNUmakefile +1 -1
  234. data/share/sample/ruby-1.9.3-p0/adlint/ext-dl-callback/adlint_cinit.h +1 -1
  235. data/share/sample/ruby-1.9.3-p0/adlint/ext-dl-callback/adlint_pinit.h +1 -1
  236. data/share/sample/ruby-1.9.3-p0/adlint/ext-dl-callback/adlint_traits.yml +50 -42
  237. data/share/sample/ruby-1.9.3-p0/adlint/ext-dl/GNUmakefile +1 -1
  238. data/share/sample/ruby-1.9.3-p0/adlint/ext-dl/adlint_cinit.h +1 -1
  239. data/share/sample/ruby-1.9.3-p0/adlint/ext-dl/adlint_pinit.h +1 -1
  240. data/share/sample/ruby-1.9.3-p0/adlint/ext-dl/adlint_traits.yml +50 -42
  241. data/share/sample/ruby-1.9.3-p0/adlint/ext-etc/GNUmakefile +1 -1
  242. data/share/sample/ruby-1.9.3-p0/adlint/ext-etc/adlint_cinit.h +1 -1
  243. data/share/sample/ruby-1.9.3-p0/adlint/ext-etc/adlint_pinit.h +1 -1
  244. data/share/sample/ruby-1.9.3-p0/adlint/ext-etc/adlint_traits.yml +50 -42
  245. data/share/sample/ruby-1.9.3-p0/adlint/ext-fcntl/GNUmakefile +1 -1
  246. data/share/sample/ruby-1.9.3-p0/adlint/ext-fcntl/adlint_cinit.h +1 -1
  247. data/share/sample/ruby-1.9.3-p0/adlint/ext-fcntl/adlint_pinit.h +1 -1
  248. data/share/sample/ruby-1.9.3-p0/adlint/ext-fcntl/adlint_traits.yml +50 -42
  249. data/share/sample/ruby-1.9.3-p0/adlint/ext-fiber/GNUmakefile +1 -1
  250. data/share/sample/ruby-1.9.3-p0/adlint/ext-fiber/adlint_cinit.h +1 -1
  251. data/share/sample/ruby-1.9.3-p0/adlint/ext-fiber/adlint_pinit.h +1 -1
  252. data/share/sample/ruby-1.9.3-p0/adlint/ext-fiber/adlint_traits.yml +50 -42
  253. data/share/sample/ruby-1.9.3-p0/adlint/ext-fiddle/GNUmakefile +1 -1
  254. data/share/sample/ruby-1.9.3-p0/adlint/ext-fiddle/adlint_cinit.h +1 -1
  255. data/share/sample/ruby-1.9.3-p0/adlint/ext-fiddle/adlint_pinit.h +1 -1
  256. data/share/sample/ruby-1.9.3-p0/adlint/ext-fiddle/adlint_traits.yml +50 -42
  257. data/share/sample/ruby-1.9.3-p0/adlint/ext-gdbm/GNUmakefile +1 -1
  258. data/share/sample/ruby-1.9.3-p0/adlint/ext-gdbm/adlint_cinit.h +1 -1
  259. data/share/sample/ruby-1.9.3-p0/adlint/ext-gdbm/adlint_pinit.h +1 -1
  260. data/share/sample/ruby-1.9.3-p0/adlint/ext-gdbm/adlint_traits.yml +50 -42
  261. data/share/sample/ruby-1.9.3-p0/adlint/ext-iconv/GNUmakefile +1 -1
  262. data/share/sample/ruby-1.9.3-p0/adlint/ext-iconv/adlint_cinit.h +1 -1
  263. data/share/sample/ruby-1.9.3-p0/adlint/ext-iconv/adlint_pinit.h +1 -1
  264. data/share/sample/ruby-1.9.3-p0/adlint/ext-iconv/adlint_traits.yml +50 -42
  265. data/share/sample/ruby-1.9.3-p0/adlint/ext-io-console/GNUmakefile +1 -1
  266. data/share/sample/ruby-1.9.3-p0/adlint/ext-io-console/adlint_cinit.h +1 -1
  267. data/share/sample/ruby-1.9.3-p0/adlint/ext-io-console/adlint_pinit.h +1 -1
  268. data/share/sample/ruby-1.9.3-p0/adlint/ext-io-console/adlint_traits.yml +50 -42
  269. data/share/sample/ruby-1.9.3-p0/adlint/ext-io-nonblock/GNUmakefile +1 -1
  270. data/share/sample/ruby-1.9.3-p0/adlint/ext-io-nonblock/adlint_cinit.h +1 -1
  271. data/share/sample/ruby-1.9.3-p0/adlint/ext-io-nonblock/adlint_pinit.h +1 -1
  272. data/share/sample/ruby-1.9.3-p0/adlint/ext-io-nonblock/adlint_traits.yml +50 -42
  273. data/share/sample/ruby-1.9.3-p0/adlint/ext-io-wait/GNUmakefile +1 -1
  274. data/share/sample/ruby-1.9.3-p0/adlint/ext-io-wait/adlint_cinit.h +1 -1
  275. data/share/sample/ruby-1.9.3-p0/adlint/ext-io-wait/adlint_pinit.h +1 -1
  276. data/share/sample/ruby-1.9.3-p0/adlint/ext-io-wait/adlint_traits.yml +50 -42
  277. data/share/sample/ruby-1.9.3-p0/adlint/ext-json-generator/GNUmakefile +1 -1
  278. data/share/sample/ruby-1.9.3-p0/adlint/ext-json-generator/adlint_cinit.h +1 -1
  279. data/share/sample/ruby-1.9.3-p0/adlint/ext-json-generator/adlint_pinit.h +1 -1
  280. data/share/sample/ruby-1.9.3-p0/adlint/ext-json-generator/adlint_traits.yml +50 -42
  281. data/share/sample/ruby-1.9.3-p0/adlint/ext-json-parser/GNUmakefile +1 -1
  282. data/share/sample/ruby-1.9.3-p0/adlint/ext-json-parser/adlint_cinit.h +1 -1
  283. data/share/sample/ruby-1.9.3-p0/adlint/ext-json-parser/adlint_pinit.h +1 -1
  284. data/share/sample/ruby-1.9.3-p0/adlint/ext-json-parser/adlint_traits.yml +50 -42
  285. data/share/sample/ruby-1.9.3-p0/adlint/ext-mathn-complex/GNUmakefile +1 -1
  286. data/share/sample/ruby-1.9.3-p0/adlint/ext-mathn-complex/adlint_cinit.h +1 -1
  287. data/share/sample/ruby-1.9.3-p0/adlint/ext-mathn-complex/adlint_pinit.h +1 -1
  288. data/share/sample/ruby-1.9.3-p0/adlint/ext-mathn-complex/adlint_traits.yml +50 -42
  289. data/share/sample/ruby-1.9.3-p0/adlint/ext-mathn-rational/GNUmakefile +1 -1
  290. data/share/sample/ruby-1.9.3-p0/adlint/ext-mathn-rational/adlint_cinit.h +1 -1
  291. data/share/sample/ruby-1.9.3-p0/adlint/ext-mathn-rational/adlint_pinit.h +1 -1
  292. data/share/sample/ruby-1.9.3-p0/adlint/ext-mathn-rational/adlint_traits.yml +50 -42
  293. data/share/sample/ruby-1.9.3-p0/adlint/ext-nkf/GNUmakefile +1 -1
  294. data/share/sample/ruby-1.9.3-p0/adlint/ext-nkf/adlint_cinit.h +1 -1
  295. data/share/sample/ruby-1.9.3-p0/adlint/ext-nkf/adlint_pinit.h +1 -1
  296. data/share/sample/ruby-1.9.3-p0/adlint/ext-nkf/adlint_traits.yml +50 -42
  297. data/share/sample/ruby-1.9.3-p0/adlint/ext-openssl/GNUmakefile +1 -1
  298. data/share/sample/ruby-1.9.3-p0/adlint/ext-openssl/adlint_cinit.h +1 -1
  299. data/share/sample/ruby-1.9.3-p0/adlint/ext-openssl/adlint_pinit.h +1 -1
  300. data/share/sample/ruby-1.9.3-p0/adlint/ext-openssl/adlint_traits.yml +50 -42
  301. data/share/sample/ruby-1.9.3-p0/adlint/ext-pathname/GNUmakefile +1 -1
  302. data/share/sample/ruby-1.9.3-p0/adlint/ext-pathname/adlint_cinit.h +1 -1
  303. data/share/sample/ruby-1.9.3-p0/adlint/ext-pathname/adlint_pinit.h +1 -1
  304. data/share/sample/ruby-1.9.3-p0/adlint/ext-pathname/adlint_traits.yml +50 -42
  305. data/share/sample/ruby-1.9.3-p0/adlint/ext-psych/GNUmakefile +1 -1
  306. data/share/sample/ruby-1.9.3-p0/adlint/ext-psych/adlint_cinit.h +1 -1
  307. data/share/sample/ruby-1.9.3-p0/adlint/ext-psych/adlint_pinit.h +1 -1
  308. data/share/sample/ruby-1.9.3-p0/adlint/ext-psych/adlint_traits.yml +50 -42
  309. data/share/sample/ruby-1.9.3-p0/adlint/ext-pty/GNUmakefile +1 -1
  310. data/share/sample/ruby-1.9.3-p0/adlint/ext-pty/adlint_cinit.h +1 -1
  311. data/share/sample/ruby-1.9.3-p0/adlint/ext-pty/adlint_pinit.h +1 -1
  312. data/share/sample/ruby-1.9.3-p0/adlint/ext-pty/adlint_traits.yml +50 -42
  313. data/share/sample/ruby-1.9.3-p0/adlint/ext-racc-cparse/GNUmakefile +1 -1
  314. data/share/sample/ruby-1.9.3-p0/adlint/ext-racc-cparse/adlint_cinit.h +1 -1
  315. data/share/sample/ruby-1.9.3-p0/adlint/ext-racc-cparse/adlint_pinit.h +1 -1
  316. data/share/sample/ruby-1.9.3-p0/adlint/ext-racc-cparse/adlint_traits.yml +50 -42
  317. data/share/sample/ruby-1.9.3-p0/adlint/ext-readline/GNUmakefile +1 -1
  318. data/share/sample/ruby-1.9.3-p0/adlint/ext-readline/adlint_cinit.h +1 -1
  319. data/share/sample/ruby-1.9.3-p0/adlint/ext-readline/adlint_pinit.h +1 -1
  320. data/share/sample/ruby-1.9.3-p0/adlint/ext-readline/adlint_traits.yml +50 -42
  321. data/share/sample/ruby-1.9.3-p0/adlint/ext-ripper/GNUmakefile +1 -1
  322. data/share/sample/ruby-1.9.3-p0/adlint/ext-ripper/adlint_cinit.h +1 -1
  323. data/share/sample/ruby-1.9.3-p0/adlint/ext-ripper/adlint_pinit.h +1 -1
  324. data/share/sample/ruby-1.9.3-p0/adlint/ext-ripper/adlint_traits.yml +50 -42
  325. data/share/sample/ruby-1.9.3-p0/adlint/ext-sdbm/GNUmakefile +1 -1
  326. data/share/sample/ruby-1.9.3-p0/adlint/ext-sdbm/adlint_cinit.h +1 -1
  327. data/share/sample/ruby-1.9.3-p0/adlint/ext-sdbm/adlint_pinit.h +1 -1
  328. data/share/sample/ruby-1.9.3-p0/adlint/ext-sdbm/adlint_traits.yml +50 -42
  329. data/share/sample/ruby-1.9.3-p0/adlint/ext-socket/GNUmakefile +1 -1
  330. data/share/sample/ruby-1.9.3-p0/adlint/ext-socket/adlint_cinit.h +1 -1
  331. data/share/sample/ruby-1.9.3-p0/adlint/ext-socket/adlint_pinit.h +1 -1
  332. data/share/sample/ruby-1.9.3-p0/adlint/ext-socket/adlint_traits.yml +50 -42
  333. data/share/sample/ruby-1.9.3-p0/adlint/ext-stringio/GNUmakefile +1 -1
  334. data/share/sample/ruby-1.9.3-p0/adlint/ext-stringio/adlint_cinit.h +1 -1
  335. data/share/sample/ruby-1.9.3-p0/adlint/ext-stringio/adlint_pinit.h +1 -1
  336. data/share/sample/ruby-1.9.3-p0/adlint/ext-stringio/adlint_traits.yml +50 -42
  337. data/share/sample/ruby-1.9.3-p0/adlint/ext-strscan/GNUmakefile +1 -1
  338. data/share/sample/ruby-1.9.3-p0/adlint/ext-strscan/adlint_cinit.h +1 -1
  339. data/share/sample/ruby-1.9.3-p0/adlint/ext-strscan/adlint_pinit.h +1 -1
  340. data/share/sample/ruby-1.9.3-p0/adlint/ext-strscan/adlint_traits.yml +50 -42
  341. data/share/sample/ruby-1.9.3-p0/adlint/ext-syck/GNUmakefile +1 -1
  342. data/share/sample/ruby-1.9.3-p0/adlint/ext-syck/adlint_cinit.h +1 -1
  343. data/share/sample/ruby-1.9.3-p0/adlint/ext-syck/adlint_pinit.h +1 -1
  344. data/share/sample/ruby-1.9.3-p0/adlint/ext-syck/adlint_traits.yml +50 -42
  345. data/share/sample/ruby-1.9.3-p0/adlint/ext-syslog/GNUmakefile +1 -1
  346. data/share/sample/ruby-1.9.3-p0/adlint/ext-syslog/adlint_cinit.h +1 -1
  347. data/share/sample/ruby-1.9.3-p0/adlint/ext-syslog/adlint_pinit.h +1 -1
  348. data/share/sample/ruby-1.9.3-p0/adlint/ext-syslog/adlint_traits.yml +50 -42
  349. data/share/sample/ruby-1.9.3-p0/adlint/ext-zlib/GNUmakefile +1 -1
  350. data/share/sample/ruby-1.9.3-p0/adlint/ext-zlib/adlint_cinit.h +1 -1
  351. data/share/sample/ruby-1.9.3-p0/adlint/ext-zlib/adlint_pinit.h +1 -1
  352. data/share/sample/ruby-1.9.3-p0/adlint/ext-zlib/adlint_traits.yml +50 -42
  353. data/share/sample/screen-4.0.3/adlint/GNUmakefile +1 -1
  354. data/share/sample/screen-4.0.3/adlint/adlint_cinit.h +1 -1
  355. data/share/sample/screen-4.0.3/adlint/adlint_pinit.h +1 -1
  356. data/share/sample/screen-4.0.3/adlint/adlint_traits.yml +50 -42
  357. data/share/sample/vim-7.3/adlint/vim/GNUmakefile +1 -1
  358. data/share/sample/vim-7.3/adlint/vim/adlint_cinit.h +1 -1
  359. data/share/sample/vim-7.3/adlint/vim/adlint_pinit.h +1 -1
  360. data/share/sample/vim-7.3/adlint/vim/adlint_traits.yml +50 -42
  361. data/share/sample/vim-7.3/adlint/xxd/GNUmakefile +1 -1
  362. data/share/sample/vim-7.3/adlint/xxd/adlint_cinit.h +1 -1
  363. data/share/sample/vim-7.3/adlint/xxd/adlint_pinit.h +1 -1
  364. data/share/sample/vim-7.3/adlint/xxd/adlint_traits.yml +49 -41
  365. data/share/sample/zsh-4.3.15/adlint/GNUmakefile +1 -1
  366. data/share/sample/zsh-4.3.15/adlint/adlint_traits.yml +46 -38
  367. data/share/sample/zsh-4.3.15/adlint/builtins/GNUmakefile +1 -1
  368. data/share/sample/zsh-4.3.15/adlint/builtins/adlint_cinit.h +1 -1
  369. data/share/sample/zsh-4.3.15/adlint/builtins/adlint_pinit.h +1 -1
  370. data/share/sample/zsh-4.3.15/adlint/builtins/adlint_traits.yml +50 -42
  371. data/share/sample/zsh-4.3.15/adlint/core/GNUmakefile +1 -1
  372. data/share/sample/zsh-4.3.15/adlint/core/adlint_cinit.h +1 -1
  373. data/share/sample/zsh-4.3.15/adlint/core/adlint_pinit.h +1 -1
  374. data/share/sample/zsh-4.3.15/adlint/core/adlint_traits.yml +50 -42
  375. data/share/sample/zsh-4.3.15/adlint/modules/GNUmakefile +1 -1
  376. data/share/sample/zsh-4.3.15/adlint/modules/adlint_cinit.h +1 -1
  377. data/share/sample/zsh-4.3.15/adlint/modules/adlint_pinit.h +1 -1
  378. data/share/sample/zsh-4.3.15/adlint/modules/adlint_traits.yml +50 -42
  379. data/share/sample/zsh-4.3.15/adlint/zle/GNUmakefile +1 -1
  380. data/share/sample/zsh-4.3.15/adlint/zle/adlint_cinit.h +1 -1
  381. data/share/sample/zsh-4.3.15/adlint/zle/adlint_pinit.h +1 -1
  382. data/share/sample/zsh-4.3.15/adlint/zle/adlint_traits.yml +50 -42
  383. data/spec/adlint/{c → cc1}/ctrlexpr_spec.rb +51 -49
  384. data/spec/adlint/{c → cc1}/domain_spec.rb +210 -179
  385. data/spec/adlint/{c → cc1}/operator_spec.rb +3 -3
  386. data/spec/adlint/{c → cc1}/syntax_spec.rb +10 -12
  387. data/spec/adlint/{c → cc1}/type_spec.rb +61 -68
  388. data/{lib/adlint/c.rb → spec/adlint/location_spec.rb} +24 -29
  389. data/spec/conf.d/default_traits.yml +38 -37
  390. data/spec/conf.d/empty_cinit.h +1 -1
  391. data/spec/conf.d/empty_pinit.h +1 -1
  392. data/spec/conf.d/project/foo.c +0 -0
  393. data/spec/spec_helper.rb +2 -2
  394. metadata +60 -40
  395. data/lib/adlint/c/domain.rb +0 -7931
  396. data/lib/adlint/c/lexer.rb +0 -252
  397. data/lib/adlint/c/phase.rb +0 -135
  398. data/lib/adlint/exam/c_builtin/c_check.rb +0 -20745
  399. data/lib/adlint/exam/c_builtin/c_check_shima.rb +0 -983
  400. data/lib/adlint/exam/c_builtin/c_code.rb +0 -477
  401. data/lib/adlint/exam/c_builtin/c_metric.rb +0 -818
data/bin/adlint_cma CHANGED
@@ -3,7 +3,7 @@
3
3
  # Cross module analyzer.
4
4
  #
5
5
  # Author:: Yutaka Yanoh <mailto:yanoh@users.sourceforge.net>
6
- # Copyright:: Copyright (C) 2010-2012, OGIS-RI Co.,Ltd.
6
+ # Copyright:: Copyright (C) 2010-2013, OGIS-RI Co.,Ltd.
7
7
  # License:: GPLv3+: GNU General Public License version 3 or later
8
8
  #
9
9
  # Owner:: Yutaka Yanoh <mailto:yanoh@users.sourceforge.net>
@@ -13,7 +13,7 @@
13
13
  # / | / _ |/ / / / | / /__ __/ Source Code Static Analyzer
14
14
  # / /| | / / / / / / / |/ / / / AdLint - Advanced Lint
15
15
  # / __ |/ /_/ / /___/ / /| / / /
16
- # /_/ |_|_____/_____/_/_/ |_/ /_/ Copyright (C) 2010-2012, OGIS-RI Co.,Ltd.
16
+ # /_/ |_|_____/_____/_/_/ |_/ /_/ Copyright (C) 2010-2013, OGIS-RI Co.,Ltd.
17
17
  #
18
18
  # This file is part of AdLint.
19
19
  #
@@ -53,7 +53,7 @@ EOS
53
53
 
54
54
  require "getoptlong"
55
55
 
56
- parser = GetoptLong.new(
56
+ getopt = GetoptLong.new(
57
57
  ["--traits", "-t", GetoptLong::REQUIRED_ARGUMENT],
58
58
  ["--output-dir", "-o", GetoptLong::REQUIRED_ARGUMENT],
59
59
  ["--verbose", "-v", GetoptLong::NO_ARGUMENT],
@@ -68,12 +68,12 @@ begin
68
68
  output_dpath = nil
69
69
  verbose = false
70
70
 
71
- parser.each_option do |option, value|
72
- case option
71
+ getopt.each_option do |opt_name, opt_val|
72
+ case opt_name
73
73
  when "--traits"
74
- traits_fpath = Pathname.new(value)
74
+ traits_fpath = Pathname.new(opt_val)
75
75
  when "--output-dir"
76
- output_dpath = Pathname.new(value)
76
+ output_dpath = Pathname.new(opt_val)
77
77
  when "--verbose"
78
78
  verbose = true
79
79
  when "--version"
@@ -95,9 +95,9 @@ rescue
95
95
  exit 1
96
96
  end
97
97
 
98
- fpaths = ARGV.map { |str| Pathname.new(str) }
98
+ input_fpaths = ARGV.map { |str| Pathname.new(str) }
99
99
 
100
- if fpaths.empty?
100
+ if input_fpaths.empty?
101
101
  $stderr.puts "#{File.basename(__FILE__)}: no input files"
102
102
  $stderr.puts usage
103
103
  exit 1
@@ -109,8 +109,13 @@ unless traits_fpath
109
109
  exit 1
110
110
  end
111
111
 
112
- AdLint.setup(File.basename(__FILE__), traits_fpath, verbose)
113
-
114
- AdLint.cma(fpaths, output_dpath)
112
+ begin
113
+ adlint = AdLint::AdLint.new(traits_fpath, output_dpath, verbose)
114
+ adlint.run_cma!(input_fpaths) or exit 5
115
+ rescue => ex
116
+ $stderr.puts ex.message, ex.backtrace
117
+ $stderr.puts
118
+ exit 2
119
+ end
115
120
 
116
121
  exit 0
data/bin/adlint_sma CHANGED
@@ -3,7 +3,7 @@
3
3
  # Single module analyzer.
4
4
  #
5
5
  # Author:: Yutaka Yanoh <mailto:yanoh@users.sourceforge.net>
6
- # Copyright:: Copyright (C) 2010-2012, OGIS-RI Co.,Ltd.
6
+ # Copyright:: Copyright (C) 2010-2013, OGIS-RI Co.,Ltd.
7
7
  # License:: GPLv3+: GNU General Public License version 3 or later
8
8
  #
9
9
  # Owner:: Yutaka Yanoh <mailto:yanoh@users.sourceforge.net>
@@ -13,7 +13,7 @@
13
13
  # / | / _ |/ / / / | / /__ __/ Source Code Static Analyzer
14
14
  # / /| | / / / / / / / |/ / / / AdLint - Advanced Lint
15
15
  # / __ |/ /_/ / /___/ / /| / / /
16
- # /_/ |_|_____/_____/_/_/ |_/ /_/ Copyright (C) 2010-2012, OGIS-RI Co.,Ltd.
16
+ # /_/ |_|_____/_____/_/_/ |_/ /_/ Copyright (C) 2010-2013, OGIS-RI Co.,Ltd.
17
17
  #
18
18
  # This file is part of AdLint.
19
19
  #
@@ -56,7 +56,7 @@ EOS
56
56
 
57
57
  require "getoptlong"
58
58
 
59
- parser = GetoptLong.new(
59
+ getopt = GetoptLong.new(
60
60
  ["--traits", "-t", GetoptLong::REQUIRED_ARGUMENT],
61
61
  ["--output-dir", "-o", GetoptLong::REQUIRED_ARGUMENT],
62
62
  ["--strip", "-p", GetoptLong::REQUIRED_ARGUMENT],
@@ -73,14 +73,14 @@ begin
73
73
  strip_num = 0
74
74
  verbose = false
75
75
 
76
- parser.each_option do |option, value|
77
- case option
76
+ getopt.each_option do |opt_name, opt_val|
77
+ case opt_name
78
78
  when "--traits"
79
- traits_fpath = Pathname.new(value)
79
+ traits_fpath = Pathname.new(opt_val)
80
80
  when "--output-dir"
81
- output_dpath = Pathname.new(value)
81
+ output_dpath = Pathname.new(opt_val)
82
82
  when "--strip"
83
- strip_num = value.to_i
83
+ strip_num = opt_val.to_i
84
84
  when "--verbose"
85
85
  verbose = true
86
86
  when "--version"
@@ -102,9 +102,9 @@ rescue
102
102
  exit 1
103
103
  end
104
104
 
105
- fpaths = ARGV.map { |str| Pathname.new(str) }
105
+ input_fpaths = ARGV.map { |str| Pathname.new(str) }
106
106
 
107
- if fpaths.empty?
107
+ if input_fpaths.empty?
108
108
  $stderr.puts "#{File.basename(__FILE__)}: no input files"
109
109
  $stderr.puts usage
110
110
  exit 1
@@ -116,8 +116,18 @@ unless traits_fpath
116
116
  exit 1
117
117
  end
118
118
 
119
- AdLint.setup(File.basename(__FILE__), traits_fpath, verbose)
119
+ begin
120
+ adlint = AdLint::AdLint.new(traits_fpath, output_dpath, verbose)
120
121
 
121
- AdLint.sma(fpaths, strip_num, output_dpath)
122
+ failed = false
123
+ input_fpaths.each do |fpath|
124
+ adlint.run_sma!(fpath, strip_num) or failed = true
125
+ end
126
+ exit 4 if failed
127
+ rescue => ex
128
+ $stderr.puts ex.message, ex.backtrace
129
+ $stderr.puts
130
+ exit 2
131
+ end
122
132
 
123
133
  exit 0
data/bin/adlintize CHANGED
@@ -3,7 +3,7 @@
3
3
  # AdLint project generator.
4
4
  #
5
5
  # Author:: Yutaka Yanoh <mailto:yanoh@users.sourceforge.net>
6
- # Copyright:: Copyright (C) 2010-2012, OGIS-RI Co.,Ltd.
6
+ # Copyright:: Copyright (C) 2010-2013, OGIS-RI Co.,Ltd.
7
7
  # License:: GPLv3+: GNU General Public License version 3 or later
8
8
  #
9
9
  # Owner:: Yutaka Yanoh <mailto:yanoh@users.sourceforge.net>
@@ -13,7 +13,7 @@
13
13
  # / | / _ |/ / / / | / /__ __/ Source Code Static Analyzer
14
14
  # / /| | / / / / / / / |/ / / / AdLint - Advanced Lint
15
15
  # / __ |/ /_/ / /___/ / /| / / /
16
- # /_/ |_|_____/_____/_/_/ |_/ /_/ Copyright (C) 2010-2012, OGIS-RI Co.,Ltd.
16
+ # /_/ |_|_____/_____/_/_/ |_/ /_/ Copyright (C) 2010-2013, OGIS-RI Co.,Ltd.
17
17
  #
18
18
  # This file is part of AdLint.
19
19
  #
@@ -73,8 +73,8 @@ def print_environments
73
73
  next
74
74
  end
75
75
 
76
- traits_pattern = "#{AdLint::Config[:etcdir]}/conf.d/#{dirent}/traits-*.erb"
77
- Dir.glob(traits_pattern).each do |traits_fpath|
76
+ traits_ptn = "#{AdLint::Config[:etcdir]}/conf.d/#{dirent}/traits-*.erb"
77
+ Dir.glob(traits_ptn).each do |traits_fpath|
78
78
  basename = File.basename(traits_fpath, ".erb")
79
79
  puts "#{dirent}-#{basename.sub(/\Atraits-/, "")}"
80
80
  end
@@ -93,8 +93,14 @@ def migrate_traits_schema(traits_fpath)
93
93
  case contents
94
94
  when /^version: "1\.0\.0"$/
95
95
  migrate_traits_schema_from_1_0_0(traits_fpath, contents)
96
+ contents = File.open(traits_fpath, "r:utf-8") { |io| io.read }
97
+ migrate_traits_schema_from_2_4_0(traits_fpath, contents)
96
98
  when /^version: "2\.0\.0"$/
97
99
  migrate_traits_schema_from_2_0_0(traits_fpath, contents)
100
+ contents = File.open(traits_fpath, "r:utf-8") { |io| io.read }
101
+ migrate_traits_schema_from_2_4_0(traits_fpath, contents)
102
+ when /^version: "2\.4\.0"$/
103
+ migrate_traits_schema_from_2_4_0(traits_fpath, contents)
98
104
  else
99
105
  $stderr.puts "nothing to be done"
100
106
  end
@@ -247,6 +253,81 @@ EOS
247
253
  end
248
254
  end
249
255
 
256
+ # TODO: Refine this ad-hoc schema migration.
257
+ def migrate_traits_schema_from_2_4_0(traits_fpath, contents)
258
+ File.open(traits_fpath, "w:utf-8") do |io|
259
+ in_warn_files_in = in_warn_files_not_in = false
260
+
261
+ io.puts "# Traits file migrated by adlintize #{AdLint::SHORT_VERSION}.", ""
262
+ contents.lines.map { |str| str.chomp }.each do |line|
263
+ case line
264
+ when /\Aversion:/
265
+ io.puts "version: \"3.0.0\"", ""
266
+ when /\Aproject_traits:/
267
+ io.puts <<EOS
268
+ project_traits:
269
+
270
+ # Analysys target selection.
271
+ # Ex.
272
+ # target_files:
273
+ # inclusion_paths:
274
+ # - "../foo"
275
+ # - "../bar"
276
+ # exclusion_paths:
277
+ # - "../bar/baz"
278
+ target_files:
279
+ inclusion_paths:
280
+ - "#{vpath_from_traits_fpath(traits_fpath)}"
281
+ exclusion_paths:
282
+ EOS
283
+ when /\A include_path:/
284
+ io.puts <<EOS
285
+ # include_paths is obsolete
286
+
287
+ # include-file search paths.
288
+ # Ex.
289
+ # file_search_paths:
290
+ # - "include/foo"
291
+ # - "../include/bar"
292
+ # - "/opt/baz/include"
293
+ file_search_paths:
294
+ EOS
295
+ when /\A standard_type:/
296
+ io.puts " standard_types:"
297
+ when /\A extension_substitution:/
298
+ io.puts " extension_substitutions:"
299
+ when /\A arbitrary_substitution:/
300
+ io.puts " arbitrary_substitutions:"
301
+ when /\A individual_selection:/
302
+ io.puts " individual_suppression:"
303
+ when /\A (message_with_class:.*)\z/
304
+ io.puts <<EOS
305
+ # #{$1} is obsolete
306
+ EOS
307
+ when /\A warn_files_in:/
308
+ in_warn_files_in = true
309
+ io.puts <<EOS
310
+ # warn_files_in: is obsolete
311
+ EOS
312
+ when /\A warn_files_not_in:/
313
+ in_warn_files_not_in = true
314
+ io.puts <<EOS
315
+ # warn_files_not_in: is obsolete
316
+ EOS
317
+ when ""
318
+ in_warn_files_in = in_warn_files_not_in = false
319
+ io.puts
320
+ else
321
+ if in_warn_files_in || in_warn_files_not_in
322
+ io.puts " ##{line}"
323
+ else
324
+ io.puts line
325
+ end
326
+ end
327
+ end
328
+ end
329
+ end
330
+
250
331
  def vpath_from_traits_fpath(traits_fpath)
251
332
  Pathname.pwd.relative_path_from(Pathname.new(traits_fpath.dirname).realpath)
252
333
  end
@@ -263,7 +344,7 @@ end
263
344
 
264
345
  require "getoptlong"
265
346
 
266
- parser = GetoptLong.new(
347
+ getopt = GetoptLong.new(
267
348
  ["--traits", "-t", GetoptLong::REQUIRED_ARGUMENT],
268
349
  ["--pinit-hdr", "-p", GetoptLong::REQUIRED_ARGUMENT],
269
350
  ["--cinit-hdr", "-c", GetoptLong::REQUIRED_ARGUMENT],
@@ -294,26 +375,26 @@ begin
294
375
  environment = nil
295
376
  force_overwrite = false
296
377
 
297
- parser.each do |option, value|
298
- case option
378
+ getopt.each do |opt_name, opt_val|
379
+ case opt_name
299
380
  when "--traits"
300
- traits_fpath = Pathname.new(value)
381
+ traits_fpath = Pathname.new(opt_val)
301
382
  when "--pinit-hdr"
302
- pinit_fpath = Pathname.new(value)
383
+ pinit_fpath = Pathname.new(opt_val)
303
384
  when "--cinit-hdr"
304
- cinit_fpath = Pathname.new(value)
385
+ cinit_fpath = Pathname.new(opt_val)
305
386
  when "--list-file"
306
- list_fpath = Pathname.new(value)
387
+ list_fpath = Pathname.new(opt_val)
307
388
  when "--makefile"
308
- make_fpath = Pathname.new(value)
389
+ make_fpath = Pathname.new(opt_val)
309
390
  when "--sh-script"
310
- sh_fpath = Pathname.new(value)
391
+ sh_fpath = Pathname.new(opt_val)
311
392
  when "--bat-file"
312
- bat_fpath = Pathname.new(value)
393
+ bat_fpath = Pathname.new(opt_val)
313
394
  when "--output-dir"
314
- output_dpath = Pathname.new(value)
395
+ output_dpath = Pathname.new(opt_val)
315
396
  when "--environment"
316
- environment = value
397
+ environment = opt_val
317
398
  when "--list-environment"
318
399
  print_environments
319
400
  exit 0
@@ -329,7 +410,7 @@ begin
329
410
  puts AdLint::Config[:prefix]
330
411
  exit 0
331
412
  when "--migrate"
332
- migrate_traits_schema(Pathname.new(value))
413
+ migrate_traits_schema(Pathname.new(opt_val))
333
414
  exit 0
334
415
  when "--help"
335
416
  puts usage
@@ -2,7 +2,7 @@
2
2
  * / | / _ |/ / / / | / /__ __/ Source Code Static Analyzer
3
3
  * / /| | / / / / / / / |/ / / / AdLint - Advanced Lint
4
4
  * / __ |/ /_/ / /___/ / /| / / /
5
- * /_/ |_|_____/_____/_/_/ |_/ /_/ Copyright (C) 2010-2012, OGIS-RI Co.,Ltd.
5
+ * /_/ |_|_____/_____/_/_/ |_/ /_/ Copyright (C) 2010-2013, OGIS-RI Co.,Ltd.
6
6
  *
7
7
  * Compiler specific initial header file generated by adlintize <%= AdLint::SHORT_VERSION %>
8
8
  * at <%= Time.now %>.
@@ -2,7 +2,7 @@
2
2
  # / | / _ |/ / / / | / /__ __/ Source Code Static Analyzer
3
3
  # / /| | / / / / / / / |/ / / / AdLint - Advanced Lint
4
4
  # / __ |/ /_/ / /___/ / /| / / /
5
- # /_/ |_|_____/_____/_/_/ |_/ /_/ Copyright (C) 2010-2012, OGIS-RI Co.,Ltd.
5
+ # /_/ |_|_____/_____/_/_/ |_/ /_/ Copyright (C) 2010-2013, OGIS-RI Co.,Ltd.
6
6
  #
7
7
  # Traits file generated by adlintize <%= AdLint::SHORT_VERSION %> at <%= Time.now %>.
8
8
 
@@ -29,19 +29,32 @@ project_traits:
29
29
  # Project root directory.
30
30
  project_root: "<%= vpath %>"
31
31
 
32
- # Project specific additional include paths.
32
+ # Analysys target selection.
33
33
  # Ex.
34
- # include_path:
35
- # - "include/foo"
36
- # - "../include/bar"
37
- # - "/opt/baz/include"
38
- include_path:
34
+ # target_files:
35
+ # inclusion_paths:
36
+ # - "../foo"
37
+ # - "../bar"
38
+ # exclusion_paths:
39
+ # - "../bar/baz"
40
+ target_files:
41
+ inclusion_paths:
42
+ - "<%= vpath %>"
43
+ exclusion_paths:
39
44
 
40
45
  # Pathname of the project specific initial header file.
41
46
  # This header file is automatically included above the first line of the
42
47
  # target source file.
43
48
  initial_header: "<%= pinit_fpath.basename %>"
44
49
 
50
+ # Project specific additional include paths.
51
+ # Ex.
52
+ # file_search_paths:
53
+ # - "include/foo"
54
+ # - "../include/bar"
55
+ # - "/opt/baz/include"
56
+ file_search_paths:
57
+
45
58
  #
46
59
  # Project specific coding style section
47
60
  #
@@ -100,10 +113,17 @@ compiler_traits:
100
113
  # project specific initial header file.
101
114
  initial_header: "<%= cinit_fpath.basename %>"
102
115
 
116
+ # Compiler specific include paths.
117
+ # Ex.
118
+ # file_search_paths:
119
+ # - "/usr/include"
120
+ # - "/usr/local/include"
121
+ file_search_paths:
122
+
103
123
  #
104
124
  # Compiler specific standard type section
105
125
  #
106
- standard_type:
126
+ standard_types:
107
127
 
108
128
  # Bit size of the `char' type family.
109
129
  char_size: 8
@@ -158,47 +178,40 @@ compiler_traits:
158
178
  # Treat the `char' type as same as the `unsigned char' type?
159
179
  char_as_unsigned_char: true
160
180
 
161
- # Compiler specific include paths.
162
- # Ex.
163
- # include_path:
164
- # - "/usr/include"
165
- # - "/usr/local/include"
166
- include_path:
167
-
168
181
  # Treat the `>>' operator as a logical shift, not an arithmetic shift?
169
182
  arithmetic:
170
183
  logical_right_shift: true
171
184
 
185
+ # Max length of all symbols can be identified by the compiler.
186
+ identifier_max: 128
187
+
172
188
  # Token substitution setting to warn the use of compiler specific extensions.
173
189
  #
174
190
  # If your compiler supports `__attribute__(...)' extension and you want to
175
191
  # know the use of this extension, specify as below.
176
- # extension_substitution:
192
+ # extension_substitutions:
177
193
  # "__attribute__(__adlint__any)": ""
178
194
  # The token sequence consists of `__attribute__', `(', any kind of tokens,
179
195
  # `)' will be replaced with nothing (erased) after the preprocessing phase.
180
196
  # And this substitution will be warned by the message W0061.
181
- extension_substitution:
197
+ extension_substitutions:
182
198
 
183
199
  # Token substitution setting to silently ignore the use of compiler specific
184
200
  # extensions.
185
201
  #
186
202
  # If your compiler supports `__asm__ volatile (...)' extension and you do not
187
203
  # mind the use of this extension, specify as below.
188
- # arbitrary_substitution:
204
+ # arbitrary_substitutions:
189
205
  # "__asm__ __adlint__any(__adlint__any)": ""
190
206
  # The token sequence consists of `__asm__', any kind of tokens, `(', any kind
191
207
  # of tokens, `)' will be replaced with nothing (erased) silently after the
192
208
  # preprocessing phase.
193
- arbitrary_substitution:
209
+ arbitrary_substitutions:
194
210
  "typeof": "__typeof__"
195
211
  "__typeof": "__typeof__"
196
212
  "alignof": "__alignof__"
197
213
  "__alignof": "__alignof__"
198
214
 
199
- # Max length of all symbols can be identified by the compiler.
200
- identifier_max: 128
201
-
202
215
  #
203
216
  # Linker specific traits section
204
217
  #
@@ -220,21 +233,8 @@ message_traits:
220
233
  # Please help to translate the message catalog into your language.
221
234
  language: "<%= lang %>"
222
235
 
223
- # Output messages with category and severity information?
224
- message_with_class: false
225
-
226
- # Warn only files in the specified directory.
227
- # If omitted, all files including system headers will be warned.
228
- warn_files_in:
229
- - "<%= vpath %>"
230
-
231
- # Don't warn files in the specified directory.
232
- # You can specify 3rd-party library header directories imported in the
233
- # project to suppress warnings about unconcerned headers.
234
- warn_files_not_in:
235
-
236
- # Enable translation-unit specific code check selection?
237
- individual_selection: true
236
+ # Enable inline annotation based message suppression?
237
+ individual_suppression: true
238
238
 
239
239
  # Project-wide code check exclusion settings.
240
240
  # Ex.