adlint 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/AUTHORS +27 -0
- data/COPYING +674 -0
- data/ChangeLog +820 -0
- data/INSTALL +78 -0
- data/MANIFEST +464 -0
- data/NEWS +38 -0
- data/README +74 -0
- data/Rakefile +167 -0
- data/TODO +29 -0
- data/bin/adlint +141 -0
- data/bin/adlint_chk +129 -0
- data/bin/adlint_cma +122 -0
- data/bin/adlint_sma +129 -0
- data/bin/adlintize +286 -0
- data/etc/conf.d/fallback/cinit.erb +11 -0
- data/etc/conf.d/fallback/traits.erb +216 -0
- data/etc/conf.d/i686-cygwin/cinit-gcc_4.3.4.erb +149 -0
- data/etc/conf.d/i686-cygwin/traits-gcc_4.3.4.erb +227 -0
- data/etc/conf.d/i686-devkit/cinit-gcc_4.5.2.erb +224 -0
- data/etc/conf.d/i686-devkit/traits-gcc_4.5.2.erb +226 -0
- data/etc/conf.d/i686-linux/cinit-gcc_4.5.1.erb +219 -0
- data/etc/conf.d/i686-linux/traits-gcc_4.5.1.erb +224 -0
- data/etc/conf.d/i686-mingw/cinit-gcc_4.6.1.erb +234 -0
- data/etc/conf.d/i686-mingw/traits-gcc_4.6.1.erb +226 -0
- data/etc/conf.d/noarch/GNUmakefile.erb +119 -0
- data/etc/conf.d/noarch/adlint_all_bat.erb +9 -0
- data/etc/conf.d/noarch/adlint_all_sh.erb +10 -0
- data/etc/conf.d/noarch/pinit.erb +11 -0
- data/etc/mesg.d/en_US/messages.yml +784 -0
- data/etc/mesg.d/ja_JP/messages.yml +784 -0
- data/lib/adlint/analyzer.rb +294 -0
- data/lib/adlint/c/branch.rb +251 -0
- data/lib/adlint/c/builtin.rb +92 -0
- data/lib/adlint/c/code.rb +490 -0
- data/lib/adlint/c/const.rb +465 -0
- data/lib/adlint/c/conv.rb +212 -0
- data/lib/adlint/c/ctrlexpr.rb +949 -0
- data/lib/adlint/c/domain.rb +7499 -0
- data/lib/adlint/c/environ.rb +133 -0
- data/lib/adlint/c/expr.rb +1725 -0
- data/lib/adlint/c/format.rb +3209 -0
- data/lib/adlint/c/interp.rb +1740 -0
- data/lib/adlint/c/lexer.rb +241 -0
- data/lib/adlint/c/mediator.rb +313 -0
- data/lib/adlint/c/message.rb +13597 -0
- data/lib/adlint/c/metric.rb +765 -0
- data/lib/adlint/c/object.rb +1018 -0
- data/lib/adlint/c/parser.rb +3800 -0
- data/lib/adlint/c/parser.y +2054 -0
- data/lib/adlint/c/phase.rb +712 -0
- data/lib/adlint/c/resolver.rb +270 -0
- data/lib/adlint/c/scanner.rb +248 -0
- data/lib/adlint/c/scope.rb +74 -0
- data/lib/adlint/c/syntax.rb +4279 -0
- data/lib/adlint/c/type.rb +7506 -0
- data/lib/adlint/c/util.rb +91 -0
- data/lib/adlint/c/value.rb +2310 -0
- data/lib/adlint/c.rb +56 -0
- data/lib/adlint/code.rb +500 -0
- data/lib/adlint/cpp/code.rb +189 -0
- data/lib/adlint/cpp/constexpr.rb +721 -0
- data/lib/adlint/cpp/constexpr.y +389 -0
- data/lib/adlint/cpp/eval.rb +1012 -0
- data/lib/adlint/cpp/lexer.rb +860 -0
- data/lib/adlint/cpp/macro.rb +637 -0
- data/lib/adlint/cpp/message.rb +992 -0
- data/lib/adlint/cpp/phase.rb +176 -0
- data/lib/adlint/cpp/scanner.rb +93 -0
- data/lib/adlint/cpp/source.rb +169 -0
- data/lib/adlint/cpp/subst.rb +300 -0
- data/lib/adlint/cpp/syntax.rb +1412 -0
- data/lib/adlint/cpp/util.rb +97 -0
- data/lib/adlint/cpp.rb +43 -0
- data/lib/adlint/driver.rb +147 -0
- data/lib/adlint/error.rb +179 -0
- data/lib/adlint/lang.rb +97 -0
- data/lib/adlint/ld/message.rb +259 -0
- data/lib/adlint/ld/metric.rb +57 -0
- data/lib/adlint/ld/object.rb +542 -0
- data/lib/adlint/ld/phase.rb +193 -0
- data/lib/adlint/ld/typedef.rb +109 -0
- data/lib/adlint/ld/util.rb +88 -0
- data/lib/adlint/ld.rb +37 -0
- data/lib/adlint/lexer.rb +293 -0
- data/lib/adlint/message.rb +368 -0
- data/lib/adlint/metric.rb +805 -0
- data/lib/adlint/monitor.rb +144 -0
- data/lib/adlint/phase.rb +90 -0
- data/lib/adlint/prelude.rb +314 -0
- data/lib/adlint/report.rb +617 -0
- data/lib/adlint/source.rb +155 -0
- data/lib/adlint/symbol.rb +127 -0
- data/lib/adlint/token.rb +215 -0
- data/lib/adlint/traits.rb +643 -0
- data/lib/adlint/util.rb +524 -0
- data/lib/adlint/version.rb +71 -0
- data/lib/adlint.rb +66 -0
- data/share/HEADER +45 -0
- data/share/demo/Makefile +110 -0
- data/share/demo/ambig_operator/ambig_operator.c +289 -0
- data/share/demo/arg_points_unset/arg_points_unset.c +37 -0
- data/share/demo/array_range/array_range.c +62 -0
- data/share/demo/bad_bitfields/bad_bitfields.c +74 -0
- data/share/demo/bad_brace/bad_brace.c +19 -0
- data/share/demo/bad_charset/abcde$.h +0 -0
- data/share/demo/bad_charset/bad_charset.c +22 -0
- data/share/demo/bad_comment/bad_comment.c +3 -0
- data/share/demo/bad_const/bad_const.c +19 -0
- data/share/demo/bad_conv/bad_conv.c +48 -0
- data/share/demo/bad_indent/bad_indent.c +50 -0
- data/share/demo/bad_init/bad_init.c +49 -0
- data/share/demo/bad_macro/bad_macro.c +97 -0
- data/share/demo/bitwise_expr/bitwise_expr.c +19 -0
- data/share/demo/call_by_value/call_by_value.c +26 -0
- data/share/demo/cross_ref/cross_ref.c +21 -0
- data/share/demo/dangling_else/dangling_else.c +20 -0
- data/share/demo/dead_code/dead_code.c +237 -0
- data/share/demo/deep_nest/deep_nest.c +57 -0
- data/share/demo/dense_switch/dense_switch.c +62 -0
- data/share/demo/direct_recur/direct_recur.c +15 -0
- data/share/demo/div_by_zero/div_by_zero.c +35 -0
- data/share/demo/dos_source/dos_source.c +7 -0
- data/share/demo/funptr_cast/funptr_cast.c +26 -0
- data/share/demo/goto_stmt/goto_stmt.c +19 -0
- data/share/demo/id_hiding/id_hiding.c +19 -0
- data/share/demo/ill_defined/ill_defined.c +13 -0
- data/share/demo/implicit_conv/implicit_conv.c +60 -0
- data/share/demo/implicit_int/implicit_int.c +14 -0
- data/share/demo/incomplete_type/incomplete_type.c +49 -0
- data/share/demo/indirect_recur/indirect_recur_1.c +14 -0
- data/share/demo/indirect_recur/indirect_recur_1.h +7 -0
- data/share/demo/indirect_recur/indirect_recur_2.c +12 -0
- data/share/demo/indirect_recur/indirect_recur_2.h +6 -0
- data/share/demo/indirect_recur/indirect_recur_3.c +6 -0
- data/share/demo/indirect_recur/indirect_recur_3.h +6 -0
- data/share/demo/indirect_recur/indirect_recur_4.c +25 -0
- data/share/demo/intro_demo/intro_demo.c +76 -0
- data/share/demo/intro_demo/intro_demo.h +12 -0
- data/share/demo/intro_demo/useless_header.h +5 -0
- data/share/demo/invalid_call/invalid_call.c +32 -0
- data/share/demo/kandr_fundef/kandr_fundef.c +10 -0
- data/share/demo/line_comment/line_comment.c +12 -0
- data/share/demo/local_decl/local_decl.c +9 -0
- data/share/demo/logical_trick/logical_trick.c +36 -0
- data/share/demo/long_sym/long_sym.c +5 -0
- data/share/demo/loop_var/loop_var.c +92 -0
- data/share/demo/malloc_or_die/malloc_or_die.c +43 -0
- data/share/demo/may_be_null/may_be_null.c +52 -0
- data/share/demo/may_be_null_arith/may_be_null_arith.c +15 -0
- data/share/demo/may_be_unset/may_be_unset.c +34 -0
- data/share/demo/mmapped_io/mmapped_io.c +23 -0
- data/share/demo/multi_break/multi_break.c +33 -0
- data/share/demo/multi_decl/multi_decl_1.c +17 -0
- data/share/demo/multi_decl/multi_decl_1.h +6 -0
- data/share/demo/multi_decl/multi_decl_2.c +13 -0
- data/share/demo/multi_decl/multi_decl_2.h +6 -0
- data/share/demo/multi_decl/multi_decl_3.c +22 -0
- data/share/demo/multi_def/multi_def_1.c +36 -0
- data/share/demo/multi_def/multi_def_1.h +6 -0
- data/share/demo/multi_def/multi_def_2.c +22 -0
- data/share/demo/multi_def/multi_def_2.h +6 -0
- data/share/demo/multi_def/multi_def_3.c +6 -0
- data/share/demo/multi_typedef/multi_typedef.c +11 -0
- data/share/demo/multi_typedef/multi_typedef_1.h +1 -0
- data/share/demo/multi_typedef/multi_typedef_2.h +1 -0
- data/share/demo/must_be_false/must_be_false.c +53 -0
- data/share/demo/must_be_null/must_be_null.c +13 -0
- data/share/demo/must_be_null_arith/must_be_null_arith.c +14 -0
- data/share/demo/must_be_true/must_be_true.c +21 -0
- data/share/demo/no_eof_nl/no_eof_nl.c +4 -0
- data/share/demo/no_void_arg/no_void_arg.c +14 -0
- data/share/demo/null_stmt/null_stmt.c +19 -0
- data/share/demo/octal_const/octal_const.c +20 -0
- data/share/demo/output_by_param/output_by_param.c +17 -0
- data/share/demo/overflow/overflow.c +74 -0
- data/share/demo/press_release/press_release.c +40 -0
- data/share/demo/retn_lvar_addr/retn_lvar_addr.c +47 -0
- data/share/demo/shift_expr/shift_expr.c +14 -0
- data/share/demo/should_be_typedef/should_be_typedef.c +51 -0
- data/share/demo/static_paths/static_paths.c +153 -0
- data/share/demo/static_vars/static_vars.c +39 -0
- data/share/demo/tag_hiding/tag_hiding.c +18 -0
- data/share/demo/tricky_incdec/tricky_incdec.c +12 -0
- data/share/demo/undefined_macro/undefined_macro.c +17 -0
- data/share/demo/uninit_vars/uninit_vars.c +28 -0
- data/share/demo/union_type/union_type.c +23 -0
- data/share/demo/unmatch_decl/unmatch_decl_1.c +12 -0
- data/share/demo/unmatch_decl/unmatch_decl_1.h +8 -0
- data/share/demo/unmatch_decl/unmatch_decl_2.c +10 -0
- data/share/demo/unmatch_decl/unmatch_decl_2.h +8 -0
- data/share/demo/unmatch_decl/unmatch_decl_3.c +7 -0
- data/share/demo/unmatch_paren_macro/unmatch_paren_macro.c +15 -0
- data/share/demo/unreachable/unreachable.c +34 -0
- data/share/demo/useless_exp_funs/useless_exp_funs_1.c +14 -0
- data/share/demo/useless_exp_funs/useless_exp_funs_1.h +1 -0
- data/share/demo/useless_exp_funs/useless_exp_funs_2.c +6 -0
- data/share/demo/useless_exp_vars/useless_export_1.c +8 -0
- data/share/demo/useless_exp_vars/useless_export_1.h +1 -0
- data/share/demo/useless_exp_vars/useless_export_2.c +7 -0
- data/share/demo/useless_expr/useless_expr.c +17 -0
- data/share/demo/useless_funs/useless_funs_1.c +21 -0
- data/share/demo/useless_funs/useless_funs_1.h +8 -0
- data/share/demo/useless_funs/useless_funs_2.c +6 -0
- data/share/demo/useless_header/useless_header.c +9 -0
- data/share/demo/useless_header/useless_header_1.h +12 -0
- data/share/demo/useless_header/useless_header_2.h +6 -0
- data/share/demo/useless_header/useless_header_3.h +9 -0
- data/share/demo/useless_header/useless_header_4.h +3 -0
- data/share/demo/useless_vars/useless_vars.c +17 -0
- data/share/demo/va_funcall/va_funcall.c +25 -0
- data/share/demo/various_fundef/various_fundef.c +36 -0
- data/share/demo/wchar_wstring/wchar_wstring.c +7 -0
- data/share/demo/wrap_around/wrap_around.c +38 -0
- data/share/doc/Makefile +16 -0
- data/share/doc/adlint_on_adqua.png +0 -0
- data/share/doc/adlint_on_eclipse_en.png +0 -0
- data/share/doc/adlint_on_eclipse_ja.png +0 -0
- data/share/doc/adlint_on_vim_en.png +0 -0
- data/share/doc/adlint_on_vim_ja.png +0 -0
- data/share/doc/developers_guide_ja.html +171 -0
- data/share/doc/developers_guide_ja.texi +87 -0
- data/share/doc/gen_mesg_sections.rb +39 -0
- data/share/doc/samples/GNUmakefile +162 -0
- data/share/doc/samples/adlint_traits.yml +238 -0
- data/share/doc/texinfo.css +22 -0
- data/share/doc/users_guide_en.html +39975 -0
- data/share/doc/users_guide_en.texi +32640 -0
- data/share/doc/users_guide_ja.html +40505 -0
- data/share/doc/users_guide_ja.texi +33189 -0
- data/share/logo/adlint-110.png +0 -0
- data/share/logo/adlint-524.png +0 -0
- data/share/logo/adlint.svg +4637 -0
- data/share/sample/README +6 -0
- data/share/sample/bison-2.5/adlint/GNUmakefile +170 -0
- data/share/sample/bison-2.5/adlint/adlint_traits.yml +225 -0
- data/share/sample/bison-2.5/adlint/lib/GNUmakefile +198 -0
- data/share/sample/bison-2.5/adlint/lib/adlint_cinit.h +228 -0
- data/share/sample/bison-2.5/adlint/lib/adlint_pinit.h +21 -0
- data/share/sample/bison-2.5/adlint/lib/adlint_traits.yml +238 -0
- data/share/sample/bison-2.5/adlint/src/GNUmakefile +166 -0
- data/share/sample/bison-2.5/adlint/src/adlint_cinit.h +228 -0
- data/share/sample/bison-2.5/adlint/src/adlint_pinit.h +21 -0
- data/share/sample/bison-2.5/adlint/src/adlint_traits.yml +239 -0
- data/share/sample/ctags-5.8/adlint/GNUmakefile +169 -0
- data/share/sample/ctags-5.8/adlint/adlint_cinit.h +219 -0
- data/share/sample/ctags-5.8/adlint/adlint_pinit.h +13 -0
- data/share/sample/ctags-5.8/adlint/adlint_traits.yml +225 -0
- data/share/sample/flex-2.5.35/adlint/GNUmakefile +140 -0
- data/share/sample/flex-2.5.35/adlint/adlint_cinit.h +219 -0
- data/share/sample/flex-2.5.35/adlint/adlint_pinit.h +14 -0
- data/share/sample/flex-2.5.35/adlint/adlint_traits.yml +225 -0
- data/share/sample/ruby-1.9.3-p0/adlint/GNUmakefile +314 -0
- data/share/sample/ruby-1.9.3-p0/adlint/adlint_traits.yml +225 -0
- data/share/sample/ruby-1.9.3-p0/adlint/core/GNUmakefile +204 -0
- data/share/sample/ruby-1.9.3-p0/adlint/core/adlint_cinit.h +228 -0
- data/share/sample/ruby-1.9.3-p0/adlint/core/adlint_pinit.h +28 -0
- data/share/sample/ruby-1.9.3-p0/adlint/core/adlint_traits.yml +240 -0
- data/share/sample/ruby-1.9.3-p0/adlint/enc/GNUmakefile +163 -0
- data/share/sample/ruby-1.9.3-p0/adlint/enc/adlint_cinit.h +228 -0
- data/share/sample/ruby-1.9.3-p0/adlint/enc/adlint_pinit.h +24 -0
- data/share/sample/ruby-1.9.3-p0/adlint/enc/adlint_traits.yml +240 -0
- data/share/sample/ruby-1.9.3-p0/adlint/enc-trans/GNUmakefile +149 -0
- data/share/sample/ruby-1.9.3-p0/adlint/enc-trans/adlint_cinit.h +228 -0
- data/share/sample/ruby-1.9.3-p0/adlint/enc-trans/adlint_pinit.h +24 -0
- data/share/sample/ruby-1.9.3-p0/adlint/enc-trans/adlint_traits.yml +240 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-bigdecimal/GNUmakefile +131 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-bigdecimal/adlint_cinit.h +228 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-bigdecimal/adlint_pinit.h +24 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-bigdecimal/adlint_traits.yml +241 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-continuation/GNUmakefile +131 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-continuation/adlint_cinit.h +228 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-continuation/adlint_pinit.h +24 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-continuation/adlint_traits.yml +241 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-coverage/GNUmakefile +131 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-coverage/adlint_cinit.h +228 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-coverage/adlint_pinit.h +24 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-coverage/adlint_traits.yml +241 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-curses/GNUmakefile +131 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-curses/adlint_cinit.h +228 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-curses/adlint_pinit.h +24 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-curses/adlint_traits.yml +241 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-date/GNUmakefile +134 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-date/adlint_cinit.h +228 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-date/adlint_pinit.h +24 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-date/adlint_traits.yml +241 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-dbm/GNUmakefile +131 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-dbm/adlint_cinit.h +228 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-dbm/adlint_pinit.h +24 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-dbm/adlint_traits.yml +241 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest/GNUmakefile +131 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest/adlint_cinit.h +228 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest/adlint_pinit.h +24 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest/adlint_traits.yml +241 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-bubblebabble/GNUmakefile +131 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-bubblebabble/adlint_cinit.h +228 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-bubblebabble/adlint_pinit.h +24 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-bubblebabble/adlint_traits.yml +242 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-md5/GNUmakefile +132 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-md5/adlint_cinit.h +228 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-md5/adlint_pinit.h +24 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-md5/adlint_traits.yml +242 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-rmd160/GNUmakefile +132 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-rmd160/adlint_cinit.h +228 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-rmd160/adlint_pinit.h +24 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-rmd160/adlint_traits.yml +242 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-sha1/GNUmakefile +132 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-sha1/adlint_cinit.h +228 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-sha1/adlint_pinit.h +24 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-sha1/adlint_traits.yml +242 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-sha2/GNUmakefile +132 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-sha2/adlint_cinit.h +228 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-sha2/adlint_pinit.h +24 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-sha2/adlint_traits.yml +242 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-dl/GNUmakefile +134 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-dl/adlint_cinit.h +228 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-dl/adlint_pinit.h +24 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-dl/adlint_traits.yml +241 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-dl-callback/GNUmakefile +140 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-dl-callback/adlint_cinit.h +228 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-dl-callback/adlint_pinit.h +24 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-dl-callback/adlint_traits.yml +242 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-etc/GNUmakefile +131 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-etc/adlint_cinit.h +228 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-etc/adlint_pinit.h +24 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-etc/adlint_traits.yml +241 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-fcntl/GNUmakefile +131 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-fcntl/adlint_cinit.h +228 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-fcntl/adlint_pinit.h +24 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-fcntl/adlint_traits.yml +241 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-fiber/GNUmakefile +131 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-fiber/adlint_cinit.h +228 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-fiber/adlint_pinit.h +24 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-fiber/adlint_traits.yml +241 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-fiddle/GNUmakefile +134 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-fiddle/adlint_cinit.h +228 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-fiddle/adlint_pinit.h +24 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-fiddle/adlint_traits.yml +242 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-gdbm/GNUmakefile +131 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-gdbm/adlint_cinit.h +228 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-gdbm/adlint_pinit.h +24 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-gdbm/adlint_traits.yml +241 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-iconv/GNUmakefile +131 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-iconv/adlint_cinit.h +228 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-iconv/adlint_pinit.h +24 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-iconv/adlint_traits.yml +241 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-io-console/GNUmakefile +131 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-io-console/adlint_cinit.h +228 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-io-console/adlint_pinit.h +24 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-io-console/adlint_traits.yml +241 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-io-nonblock/GNUmakefile +131 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-io-nonblock/adlint_cinit.h +228 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-io-nonblock/adlint_pinit.h +24 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-io-nonblock/adlint_traits.yml +241 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-io-wait/GNUmakefile +131 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-io-wait/adlint_cinit.h +228 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-io-wait/adlint_pinit.h +24 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-io-wait/adlint_traits.yml +241 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-json-generator/GNUmakefile +131 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-json-generator/adlint_cinit.h +228 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-json-generator/adlint_pinit.h +24 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-json-generator/adlint_traits.yml +241 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-json-parser/GNUmakefile +131 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-json-parser/adlint_cinit.h +228 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-json-parser/adlint_pinit.h +24 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-json-parser/adlint_traits.yml +241 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-mathn-complex/GNUmakefile +131 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-mathn-complex/adlint_cinit.h +228 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-mathn-complex/adlint_pinit.h +24 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-mathn-complex/adlint_traits.yml +241 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-mathn-rational/GNUmakefile +131 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-mathn-rational/adlint_cinit.h +228 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-mathn-rational/adlint_pinit.h +24 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-mathn-rational/adlint_traits.yml +241 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-nkf/GNUmakefile +131 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-nkf/adlint_cinit.h +228 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-nkf/adlint_pinit.h +24 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-nkf/adlint_traits.yml +241 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-openssl/GNUmakefile +162 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-openssl/adlint_cinit.h +228 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-openssl/adlint_pinit.h +24 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-openssl/adlint_traits.yml +241 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-pathname/GNUmakefile +131 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-pathname/adlint_cinit.h +228 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-pathname/adlint_pinit.h +24 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-pathname/adlint_traits.yml +241 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-psych/GNUmakefile +135 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-psych/adlint_cinit.h +228 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-psych/adlint_pinit.h +24 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-psych/adlint_traits.yml +241 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-pty/GNUmakefile +131 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-pty/adlint_cinit.h +228 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-pty/adlint_pinit.h +24 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-pty/adlint_traits.yml +241 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-racc-cparse/GNUmakefile +131 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-racc-cparse/adlint_cinit.h +228 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-racc-cparse/adlint_pinit.h +24 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-racc-cparse/adlint_traits.yml +241 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-readline/GNUmakefile +131 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-readline/adlint_cinit.h +228 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-readline/adlint_pinit.h +24 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-readline/adlint_traits.yml +241 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-ripper/GNUmakefile +131 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-ripper/adlint_cinit.h +228 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-ripper/adlint_pinit.h +24 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-ripper/adlint_traits.yml +241 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-sdbm/GNUmakefile +132 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-sdbm/adlint_cinit.h +228 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-sdbm/adlint_pinit.h +24 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-sdbm/adlint_traits.yml +241 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-socket/GNUmakefile +144 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-socket/adlint_cinit.h +228 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-socket/adlint_pinit.h +24 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-socket/adlint_traits.yml +241 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-stringio/GNUmakefile +131 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-stringio/adlint_cinit.h +228 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-stringio/adlint_pinit.h +24 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-stringio/adlint_traits.yml +241 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-strscan/GNUmakefile +131 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-strscan/adlint_cinit.h +228 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-strscan/adlint_pinit.h +24 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-strscan/adlint_traits.yml +241 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-syck/GNUmakefile +140 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-syck/adlint_cinit.h +228 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-syck/adlint_pinit.h +24 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-syck/adlint_traits.yml +241 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-syslog/GNUmakefile +131 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-syslog/adlint_cinit.h +228 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-syslog/adlint_pinit.h +24 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-syslog/adlint_traits.yml +241 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-zlib/GNUmakefile +131 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-zlib/adlint_cinit.h +228 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-zlib/adlint_pinit.h +24 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-zlib/adlint_traits.yml +241 -0
- data/share/sample/screen-4.0.3/adlint/GNUmakefile +162 -0
- data/share/sample/screen-4.0.3/adlint/adlint_cinit.h +228 -0
- data/share/sample/screen-4.0.3/adlint/adlint_pinit.h +21 -0
- data/share/sample/screen-4.0.3/adlint/adlint_traits.yml +238 -0
- data/share/sample/vim-7.3/adlint/vim/GNUmakefile +185 -0
- data/share/sample/vim-7.3/adlint/vim/adlint_cinit.h +228 -0
- data/share/sample/vim-7.3/adlint/vim/adlint_pinit.h +25 -0
- data/share/sample/vim-7.3/adlint/vim/adlint_traits.yml +250 -0
- data/share/sample/vim-7.3/adlint/xxd/GNUmakefile +131 -0
- data/share/sample/vim-7.3/adlint/xxd/adlint_cinit.h +228 -0
- data/share/sample/vim-7.3/adlint/xxd/adlint_pinit.h +24 -0
- data/share/sample/vim-7.3/adlint/xxd/adlint_traits.yml +237 -0
- data/share/sample/zsh-4.3.15/adlint/GNUmakefile +146 -0
- data/share/sample/zsh-4.3.15/adlint/adlint_traits.yml +225 -0
- data/share/sample/zsh-4.3.15/adlint/builtins/GNUmakefile +132 -0
- data/share/sample/zsh-4.3.15/adlint/builtins/adlint_cinit.h +228 -0
- data/share/sample/zsh-4.3.15/adlint/builtins/adlint_pinit.h +24 -0
- data/share/sample/zsh-4.3.15/adlint/builtins/adlint_traits.yml +240 -0
- data/share/sample/zsh-4.3.15/adlint/core/GNUmakefile +153 -0
- data/share/sample/zsh-4.3.15/adlint/core/adlint_cinit.h +228 -0
- data/share/sample/zsh-4.3.15/adlint/core/adlint_pinit.h +23 -0
- data/share/sample/zsh-4.3.15/adlint/core/adlint_traits.yml +239 -0
- data/share/sample/zsh-4.3.15/adlint/modules/GNUmakefile +147 -0
- data/share/sample/zsh-4.3.15/adlint/modules/adlint_cinit.h +228 -0
- data/share/sample/zsh-4.3.15/adlint/modules/adlint_pinit.h +24 -0
- data/share/sample/zsh-4.3.15/adlint/modules/adlint_traits.yml +240 -0
- data/share/sample/zsh-4.3.15/adlint/zle/GNUmakefile +144 -0
- data/share/sample/zsh-4.3.15/adlint/zle/adlint_cinit.h +228 -0
- data/share/sample/zsh-4.3.15/adlint/zle/adlint_pinit.h +24 -0
- data/share/sample/zsh-4.3.15/adlint/zle/adlint_traits.yml +239 -0
- data/spec/MUST_WRITE_SPECS_WITH_RSPEC +0 -0
- metadata +532 -0
data/bin/adlint_sma
ADDED
@@ -0,0 +1,129 @@
|
|
1
|
+
#! /usr/bin/env ruby
|
2
|
+
#
|
3
|
+
# Single module analyzer.
|
4
|
+
#
|
5
|
+
# Author:: Yutaka Yanoh <mailto:yanoh@users.sourceforge.net>
|
6
|
+
# Copyright:: Copyright (C) 2010-2012, OGIS-RI Co.,Ltd.
|
7
|
+
# License:: GPLv3+: GNU General Public License version 3 or later
|
8
|
+
#
|
9
|
+
# Owner:: Yutaka Yanoh <mailto:yanoh@users.sourceforge.net>
|
10
|
+
|
11
|
+
#--
|
12
|
+
# ___ ____ __ ___ _________
|
13
|
+
# / | / _ |/ / / / | / /__ __/ Source Code Static Analyzer
|
14
|
+
# / /| | / / / / / / / |/ / / / AdLint - Advanced Lint
|
15
|
+
# / __ |/ /_/ / /___/ / /| / / /
|
16
|
+
# /_/ |_|_____/_____/_/_/ |_/ /_/ Copyright (C) 2010-2012, OGIS-RI Co.,Ltd.
|
17
|
+
#
|
18
|
+
# This file is part of AdLint.
|
19
|
+
#
|
20
|
+
# AdLint is free software: you can redistribute it and/or modify it under the
|
21
|
+
# terms of the GNU General Public License as published by the Free Software
|
22
|
+
# Foundation, either version 3 of the License, or (at your option) any later
|
23
|
+
# version.
|
24
|
+
#
|
25
|
+
# AdLint is distributed in the hope that it will be useful, but WITHOUT ANY
|
26
|
+
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
27
|
+
# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
28
|
+
#
|
29
|
+
# You should have received a copy of the GNU General Public License along with
|
30
|
+
# AdLint. If not, see <http://www.gnu.org/licenses/>.
|
31
|
+
#
|
32
|
+
#++
|
33
|
+
|
34
|
+
require "pathname"
|
35
|
+
|
36
|
+
$bindir = Pathname.new(__FILE__).realpath.dirname
|
37
|
+
$prefix = Pathname.new("..").expand_path($bindir)
|
38
|
+
$libdir = Pathname.new("lib").expand_path($prefix)
|
39
|
+
$etcdir = Pathname.new("etc").expand_path($prefix)
|
40
|
+
|
41
|
+
$stdout.set_encoding(Encoding.default_external)
|
42
|
+
$stderr.set_encoding(Encoding.default_external)
|
43
|
+
|
44
|
+
$:.unshift($libdir.to_s)
|
45
|
+
|
46
|
+
require "adlint"
|
47
|
+
|
48
|
+
ADLINT_VERSION = "AdLint single module analyzer #{AdLint::VERSION}"
|
49
|
+
|
50
|
+
USAGE = <<EOS
|
51
|
+
Usage: adlint_sma [options] source-file...
|
52
|
+
Options:
|
53
|
+
-t FILE, --traits FILE Use FILE as traits file (mandatory)
|
54
|
+
-o DIR, --output-dir DIR Output result files to DIR
|
55
|
+
-p NUM, --strip NUM Use source file names from which stripped NUM
|
56
|
+
leading components as the base name of output
|
57
|
+
files
|
58
|
+
-v, --verbose Increase verbosity but suppress message output
|
59
|
+
--version Display version information
|
60
|
+
--copyright Display copyright information
|
61
|
+
--prefix Display prefix directory of AdLint
|
62
|
+
-h, --help Display this message
|
63
|
+
EOS
|
64
|
+
|
65
|
+
require "getoptlong"
|
66
|
+
|
67
|
+
parser = GetoptLong.new(["--traits", "-t", GetoptLong::REQUIRED_ARGUMENT],
|
68
|
+
["--output-dir", "-o", GetoptLong::REQUIRED_ARGUMENT],
|
69
|
+
["--strip", "-p", GetoptLong::REQUIRED_ARGUMENT],
|
70
|
+
["--verbose", "-v", GetoptLong::NO_ARGUMENT],
|
71
|
+
["--version", GetoptLong::NO_ARGUMENT],
|
72
|
+
["--copyright", GetoptLong::NO_ARGUMENT],
|
73
|
+
["--prefix", GetoptLong::NO_ARGUMENT],
|
74
|
+
["--help", "-h", GetoptLong::NO_ARGUMENT])
|
75
|
+
|
76
|
+
begin
|
77
|
+
traits_fpath = nil
|
78
|
+
output_dpath = nil
|
79
|
+
strip_num = 0
|
80
|
+
verbose = false
|
81
|
+
|
82
|
+
parser.each_option do |option, value|
|
83
|
+
case option
|
84
|
+
when "--traits"
|
85
|
+
traits_fpath = Pathname.new(value)
|
86
|
+
when "--output-dir"
|
87
|
+
output_dpath = Pathname.new(value)
|
88
|
+
when "--strip"
|
89
|
+
strip_num = value.to_i
|
90
|
+
when "--verbose"
|
91
|
+
verbose = true
|
92
|
+
when "--version"
|
93
|
+
puts ADLINT_VERSION, AdLint::AUTHOR
|
94
|
+
exit 0
|
95
|
+
when "--copyright"
|
96
|
+
puts AdLint::COPYRIGHT
|
97
|
+
exit 0
|
98
|
+
when "--prefix"
|
99
|
+
puts $prefix
|
100
|
+
exit 0
|
101
|
+
when "--help"
|
102
|
+
puts USAGE
|
103
|
+
exit 0
|
104
|
+
end
|
105
|
+
end
|
106
|
+
rescue
|
107
|
+
$stderr.puts USAGE
|
108
|
+
exit 1
|
109
|
+
end
|
110
|
+
|
111
|
+
fpaths = ARGV.map { |str| Pathname.new(str) }
|
112
|
+
|
113
|
+
if fpaths.empty?
|
114
|
+
$stderr.puts "#{File.basename(__FILE__)}: no input files"
|
115
|
+
$stderr.puts USAGE
|
116
|
+
exit 1
|
117
|
+
end
|
118
|
+
|
119
|
+
unless traits_fpath
|
120
|
+
$stderr.puts "#{File.basename(__FILE__)}: no traits file"
|
121
|
+
$stderr.puts USAGE
|
122
|
+
exit 1
|
123
|
+
end
|
124
|
+
|
125
|
+
AdLint.setup(File.basename(__FILE__), traits_fpath, verbose)
|
126
|
+
|
127
|
+
AdLint.sma(fpaths, strip_num, output_dpath)
|
128
|
+
|
129
|
+
exit 0
|
data/bin/adlintize
ADDED
@@ -0,0 +1,286 @@
|
|
1
|
+
#! /usr/bin/env ruby
|
2
|
+
#
|
3
|
+
# AdLint project generator.
|
4
|
+
#
|
5
|
+
# Author:: Yutaka Yanoh <mailto:yanoh@users.sourceforge.net>
|
6
|
+
# Copyright:: Copyright (C) 2010-2012, OGIS-RI Co.,Ltd.
|
7
|
+
# License:: GPLv3+: GNU General Public License version 3 or later
|
8
|
+
#
|
9
|
+
# Owner:: Yutaka Yanoh <mailto:yanoh@users.sourceforge.net>
|
10
|
+
|
11
|
+
#--
|
12
|
+
# ___ ____ __ ___ _________
|
13
|
+
# / | / _ |/ / / / | / /__ __/ Source Code Static Analyzer
|
14
|
+
# / /| | / / / / / / / |/ / / / AdLint - Advanced Lint
|
15
|
+
# / __ |/ /_/ / /___/ / /| / / /
|
16
|
+
# /_/ |_|_____/_____/_/_/ |_/ /_/ Copyright (C) 2010-2012, OGIS-RI Co.,Ltd.
|
17
|
+
#
|
18
|
+
# This file is part of AdLint.
|
19
|
+
#
|
20
|
+
# AdLint is free software: you can redistribute it and/or modify it under the
|
21
|
+
# terms of the GNU General Public License as published by the Free Software
|
22
|
+
# Foundation, either version 3 of the License, or (at your option) any later
|
23
|
+
# version.
|
24
|
+
#
|
25
|
+
# AdLint is distributed in the hope that it will be useful, but WITHOUT ANY
|
26
|
+
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
27
|
+
# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
28
|
+
#
|
29
|
+
# You should have received a copy of the GNU General Public License along with
|
30
|
+
# AdLint. If not, see <http://www.gnu.org/licenses/>.
|
31
|
+
#
|
32
|
+
#++
|
33
|
+
|
34
|
+
require "pathname"
|
35
|
+
|
36
|
+
$bindir = Pathname.new(__FILE__).realpath.dirname
|
37
|
+
$prefix = Pathname.new("..").expand_path($bindir)
|
38
|
+
$libdir = Pathname.new("lib").expand_path($prefix)
|
39
|
+
$etcdir = Pathname.new("etc").expand_path($prefix)
|
40
|
+
|
41
|
+
$:.unshift($libdir.to_s)
|
42
|
+
|
43
|
+
require "adlint"
|
44
|
+
|
45
|
+
ADLINT_VERSION = "AdLint project generator #{AdLint::VERSION}"
|
46
|
+
|
47
|
+
USAGE = <<EOS
|
48
|
+
Usage: adlintize [options] [project-name]
|
49
|
+
Options:
|
50
|
+
-t FILE, --traits FILE Write traits to FILE
|
51
|
+
If omitted, `adlint_traits.yml' will be used
|
52
|
+
-p FILE, --pinit-hdr FILE Write project initial header to FILE
|
53
|
+
If omitted, `adlint_pinit.h' will be used
|
54
|
+
-c FILE, --cinit-hdr FILE Write compiler initial header to FILE
|
55
|
+
If omitted, `adlint_cinit.h' will be used
|
56
|
+
-l FILE, --list-file FILE Write list file to FILE
|
57
|
+
If omitted, `adlint_files.txt' will be used
|
58
|
+
-m FILE, --makefile FILE Write analysis procedure GNUmakefile to FILE
|
59
|
+
If omitted, `GNUmakefile' will be used
|
60
|
+
-s FILE, --sh-script FILE Write analysis procedure sh script to FILE
|
61
|
+
If omitted, `adlint_all.sh' will be used
|
62
|
+
-b FILE, --bat-file FILE Write analysis procedure bat file to FILE
|
63
|
+
If omitted, `adlint_all.bat' will be used
|
64
|
+
-o DIR, --output-dir DIR Set output directory
|
65
|
+
If omitted, `.' will be used
|
66
|
+
-e ENV, --environment ENV Assume ENV as target build environment
|
67
|
+
-L, --list-environment List all preset build environments
|
68
|
+
-f, --force Force to overwrite existing files
|
69
|
+
--version Display version information
|
70
|
+
--copyright Display copyright information
|
71
|
+
--prefix Display prefix directory of AdLint
|
72
|
+
-h, --help Display this message
|
73
|
+
EOS
|
74
|
+
|
75
|
+
def print_environments
|
76
|
+
Dir.entries(Pathname.new("conf.d").expand_path($etcdir)).each do |dirent|
|
77
|
+
case dirent
|
78
|
+
when ".", "..", "fallback", "noarch"
|
79
|
+
next
|
80
|
+
end
|
81
|
+
|
82
|
+
Dir.glob("#{$etcdir}/conf.d/#{dirent}/traits-*.erb").each do |traits_fpath|
|
83
|
+
basename = File.basename(traits_fpath, ".erb")
|
84
|
+
puts "#{dirent}-#{basename.sub(/\Atraits-/, "")}"
|
85
|
+
end
|
86
|
+
end
|
87
|
+
end
|
88
|
+
|
89
|
+
require "getoptlong"
|
90
|
+
|
91
|
+
parser = GetoptLong.new(["--traits", "-t", GetoptLong::REQUIRED_ARGUMENT],
|
92
|
+
["--pinit-hdr", "-p", GetoptLong::REQUIRED_ARGUMENT],
|
93
|
+
["--cinit-hdr", "-c", GetoptLong::REQUIRED_ARGUMENT],
|
94
|
+
["--list-file", "-l", GetoptLong::REQUIRED_ARGUMENT],
|
95
|
+
["--makefile", "-m", GetoptLong::REQUIRED_ARGUMENT],
|
96
|
+
["--sh-script", "-s", GetoptLong::REQUIRED_ARGUMENT],
|
97
|
+
["--bat-file", "-b", GetoptLong::REQUIRED_ARGUMENT],
|
98
|
+
["--output-dir", "-o", GetoptLong::REQUIRED_ARGUMENT],
|
99
|
+
["--environment", "-e", GetoptLong::REQUIRED_ARGUMENT],
|
100
|
+
["--list-environment", "-L", GetoptLong::NO_ARGUMENT],
|
101
|
+
["--force", "-f", GetoptLong::NO_ARGUMENT],
|
102
|
+
["--version", GetoptLong::NO_ARGUMENT],
|
103
|
+
["--copyright", GetoptLong::NO_ARGUMENT],
|
104
|
+
["--prefix", GetoptLong::NO_ARGUMENT],
|
105
|
+
["--help", "-h", GetoptLong::NO_ARGUMENT])
|
106
|
+
|
107
|
+
begin
|
108
|
+
traits_fpath = Pathname.new("adlint_traits.yml")
|
109
|
+
pinit_fpath = Pathname.new("adlint_pinit.h")
|
110
|
+
cinit_fpath = Pathname.new("adlint_cinit.h")
|
111
|
+
list_fpath = Pathname.new("adlint_files.txt")
|
112
|
+
make_fpath = Pathname.new("GNUmakefile")
|
113
|
+
sh_fpath = Pathname.new("adlint_all.sh")
|
114
|
+
bat_fpath = Pathname.new("adlint_all.bat")
|
115
|
+
output_dpath = Pathname.new(".")
|
116
|
+
environment = nil
|
117
|
+
force_overwrite = false
|
118
|
+
|
119
|
+
parser.each do |option, value|
|
120
|
+
case option
|
121
|
+
when "--traits"
|
122
|
+
traits_fpath = Pathname.new(value)
|
123
|
+
when "--pinit-hdr"
|
124
|
+
pinit_fpath = Pathname.new(value)
|
125
|
+
when "--cinit-hdr"
|
126
|
+
cinit_fpath = Pathname.new(value)
|
127
|
+
when "--list-file"
|
128
|
+
list_fpath = Pathname.new(value)
|
129
|
+
when "--makefile"
|
130
|
+
make_fpath = Pathname.new(value)
|
131
|
+
when "--sh-script"
|
132
|
+
sh_fpath = Pathname.new(value)
|
133
|
+
when "--bat-file"
|
134
|
+
bat_fpath = Pathname.new(value)
|
135
|
+
when "--output-dir"
|
136
|
+
output_dpath = Pathname.new(value)
|
137
|
+
when "--environment"
|
138
|
+
environment = value
|
139
|
+
when "--list-environment"
|
140
|
+
print_environments
|
141
|
+
exit 0
|
142
|
+
when "--force"
|
143
|
+
force_overwrite = true
|
144
|
+
when "--version"
|
145
|
+
puts ADLINT_VERSION, AdLint::AUTHOR
|
146
|
+
exit 0
|
147
|
+
when "--copyright"
|
148
|
+
puts AdLint::COPYRIGHT
|
149
|
+
exit 0
|
150
|
+
when "--prefix"
|
151
|
+
puts $prefix
|
152
|
+
exit 0
|
153
|
+
when "--help"
|
154
|
+
puts USAGE
|
155
|
+
exit 0
|
156
|
+
end
|
157
|
+
end
|
158
|
+
rescue
|
159
|
+
$stderr.puts USAGE
|
160
|
+
exit 1
|
161
|
+
end
|
162
|
+
|
163
|
+
project_name = ARGV.empty? ? Pathname.getwd.each_filename.to_a.last : ARGV[0]
|
164
|
+
|
165
|
+
FileUtils.mkdir_p(output_dpath) if output_dpath && !Dir.exist?(output_dpath)
|
166
|
+
|
167
|
+
traits_fpath = traits_fpath.expand_path(output_dpath)
|
168
|
+
pinit_fpath = pinit_fpath.expand_path(output_dpath)
|
169
|
+
cinit_fpath = cinit_fpath.expand_path(output_dpath)
|
170
|
+
list_fpath = list_fpath.expand_path(output_dpath)
|
171
|
+
make_fpath = make_fpath.expand_path(output_dpath)
|
172
|
+
sh_fpath = sh_fpath.expand_path(output_dpath)
|
173
|
+
bat_fpath = bat_fpath.expand_path(output_dpath)
|
174
|
+
|
175
|
+
if environment
|
176
|
+
arch, os, compiler = environment.split("-")
|
177
|
+
|
178
|
+
cinit_templ_fpath =
|
179
|
+
Pathname.new("#{$etcdir}/conf.d/#{arch}-#{os}/cinit-#{compiler}.erb")
|
180
|
+
unless File.readable?(cinit_templ_fpath)
|
181
|
+
$stderr.puts "#{File.basename(__FILE__)}: no such preset build environment"
|
182
|
+
exit 1
|
183
|
+
end
|
184
|
+
|
185
|
+
traits_templ_fpath =
|
186
|
+
Pathname.new("#{$etcdir}/conf.d/#{arch}-#{os}/traits-#{compiler}.erb")
|
187
|
+
unless File.readable?(traits_templ_fpath)
|
188
|
+
$stderr.puts "#{File.basename(__FILE__)}: no such preset build environment"
|
189
|
+
exit 1
|
190
|
+
end
|
191
|
+
else
|
192
|
+
cinit_templ_fpath = Pathname.new("#{$etcdir}/conf.d/fallback/cinit.erb")
|
193
|
+
traits_templ_fpath = Pathname.new("#{$etcdir}/conf.d/fallback/traits.erb")
|
194
|
+
end
|
195
|
+
|
196
|
+
pinit_templ_fpath = Pathname.new("#{$etcdir}/conf.d/noarch/pinit.erb")
|
197
|
+
make_templ_fpath = Pathname.new("#{$etcdir}/conf.d/noarch/GNUmakefile.erb")
|
198
|
+
sh_templ_fpath = Pathname.new("#{$etcdir}/conf.d/noarch/adlint_all_sh.erb")
|
199
|
+
bat_templ_fpath = Pathname.new("#{$etcdir}/conf.d/noarch/adlint_all_bat.erb")
|
200
|
+
|
201
|
+
require "erb"
|
202
|
+
|
203
|
+
if ENV["LANG"] =~ /ja_JP/
|
204
|
+
lang = "ja_JP"
|
205
|
+
else
|
206
|
+
case Encoding.default_external
|
207
|
+
when Encoding::Windows_31J
|
208
|
+
lang = "ja_JP"
|
209
|
+
else
|
210
|
+
lang = "en_US"
|
211
|
+
end
|
212
|
+
end
|
213
|
+
|
214
|
+
if !File.exist?(traits_fpath) || force_overwrite
|
215
|
+
File.open(traits_fpath, "w") do |io|
|
216
|
+
io.set_encoding(Encoding::UTF_8)
|
217
|
+
io.puts(ERB.new(File.read(traits_templ_fpath)).result(binding))
|
218
|
+
end
|
219
|
+
else
|
220
|
+
$stderr.puts "#{File.basename(__FILE__)}: #{traits_fpath} already exists"
|
221
|
+
exit 1
|
222
|
+
end
|
223
|
+
|
224
|
+
if !File.exist?(pinit_fpath) || force_overwrite
|
225
|
+
File.open(pinit_fpath, "w") do |io|
|
226
|
+
io.set_encoding(Encoding::UTF_8)
|
227
|
+
io.puts(ERB.new(File.read(pinit_templ_fpath)).result(binding))
|
228
|
+
end
|
229
|
+
else
|
230
|
+
$stderr.puts "#{File.basename(__FILE__)}: #{pinit_fpath} already exists"
|
231
|
+
exit 1
|
232
|
+
end
|
233
|
+
|
234
|
+
if !File.exist?(cinit_fpath) || force_overwrite
|
235
|
+
File.open(cinit_fpath, "w") do |io|
|
236
|
+
io.set_encoding(Encoding::UTF_8)
|
237
|
+
io.puts(ERB.new(File.read(cinit_templ_fpath)).result(binding))
|
238
|
+
end
|
239
|
+
else
|
240
|
+
$stderr.puts "#{File.basename(__FILE__)}: #{cinit_fpath} already exists"
|
241
|
+
exit 1
|
242
|
+
end
|
243
|
+
|
244
|
+
vpath = Pathname.pwd.relative_path_from(Pathname.new(output_dpath).realpath)
|
245
|
+
|
246
|
+
if !File.exist?(list_fpath) || force_overwrite
|
247
|
+
File.open(list_fpath, "w") do |io|
|
248
|
+
io.set_encoding(Encoding::UTF_8)
|
249
|
+
Dir.glob("**/*.c").each { |str| io.puts(vpath.join(Pathname.new(str))) }
|
250
|
+
end
|
251
|
+
else
|
252
|
+
$stderr.puts "#{File.basename(__FILE__)}: #{list_fpath} already exists"
|
253
|
+
exit 1
|
254
|
+
end
|
255
|
+
|
256
|
+
if !File.exist?(make_fpath) || force_overwrite
|
257
|
+
File.open(make_fpath, "w") do |io|
|
258
|
+
io.set_encoding(Encoding::UTF_8)
|
259
|
+
io.puts(ERB.new(File.read(make_templ_fpath)).result(binding))
|
260
|
+
end
|
261
|
+
else
|
262
|
+
$stderr.puts "#{File.basename(__FILE__)}: #{make_fpath} already exists"
|
263
|
+
exit 1
|
264
|
+
end
|
265
|
+
|
266
|
+
if !File.exist?(sh_fpath) || force_overwrite
|
267
|
+
File.open(sh_fpath, "w") do |io|
|
268
|
+
io.set_encoding(Encoding::UTF_8)
|
269
|
+
io.puts(ERB.new(File.read(sh_templ_fpath)).result(binding))
|
270
|
+
end
|
271
|
+
else
|
272
|
+
$stderr.puts "#{File.basename(__FILE__)}: #{sh_fpath} already exists"
|
273
|
+
exit 1
|
274
|
+
end
|
275
|
+
|
276
|
+
if !File.exist?(bat_fpath) || force_overwrite
|
277
|
+
File.open(bat_fpath, "w") do |io|
|
278
|
+
io.set_encoding(Encoding::UTF_8)
|
279
|
+
io.puts(ERB.new(File.read(bat_templ_fpath)).result(binding))
|
280
|
+
end
|
281
|
+
else
|
282
|
+
$stderr.puts "#{File.basename(__FILE__)}: #{bat_fpath} already exists"
|
283
|
+
exit 1
|
284
|
+
end
|
285
|
+
|
286
|
+
exit 0
|
@@ -0,0 +1,11 @@
|
|
1
|
+
/* ___ ____ __ ___ _________
|
2
|
+
* / | / _ |/ / / / | / /__ __/ Source Code Static Analyzer
|
3
|
+
* / /| | / / / / / / / |/ / / / AdLint - Advanced Lint
|
4
|
+
* / __ |/ /_/ / /___/ / /| / / /
|
5
|
+
* /_/ |_|_____/_____/_/_/ |_/ /_/ Copyright (C) 2010-2012, OGIS-RI Co.,Ltd.
|
6
|
+
*
|
7
|
+
* Compiler specific initial header file generated by adlintize <%= AdLint::SHORT_VERSION %>
|
8
|
+
* at <%= Time.now %>.
|
9
|
+
*/
|
10
|
+
|
11
|
+
/* Put compiler specific predefined macros and types here. */
|
@@ -0,0 +1,216 @@
|
|
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::SHORT_VERSION %>"
|
12
|
+
|
13
|
+
#
|
14
|
+
# Project specific traits section
|
15
|
+
#
|
16
|
+
project_traits:
|
17
|
+
|
18
|
+
# Project name.
|
19
|
+
project_name: "<%= project_name %>"
|
20
|
+
|
21
|
+
# Project specific additional include paths.
|
22
|
+
# Ex.
|
23
|
+
# include_path:
|
24
|
+
# - "include/foo"
|
25
|
+
# - "../include/bar"
|
26
|
+
# - "/opt/baz/include"
|
27
|
+
include_path:
|
28
|
+
|
29
|
+
# Pathname of the project specific initial header file.
|
30
|
+
# This header file is automatically included above the first line of the
|
31
|
+
# target source file.
|
32
|
+
initial_header: "<%= pinit_fpath.basename %>"
|
33
|
+
|
34
|
+
#
|
35
|
+
# Project specific coding style section
|
36
|
+
#
|
37
|
+
coding_style:
|
38
|
+
|
39
|
+
# Indent style which is a convention governing the identation of blocks.
|
40
|
+
# Select from "K&R", "Allman" and "GNU".
|
41
|
+
#
|
42
|
+
# The value "K&R" means...
|
43
|
+
# int foo(int i)
|
44
|
+
# {
|
45
|
+
# if (i == 0) {
|
46
|
+
# return 0;
|
47
|
+
# }
|
48
|
+
# return i;
|
49
|
+
# }
|
50
|
+
#
|
51
|
+
# The value "Allman" means...
|
52
|
+
# int foo(int i)
|
53
|
+
# {
|
54
|
+
# if (i == 0)
|
55
|
+
# {
|
56
|
+
# return 0;
|
57
|
+
# }
|
58
|
+
# return i;
|
59
|
+
# }
|
60
|
+
#
|
61
|
+
# The value "GNU" means...
|
62
|
+
# int
|
63
|
+
# foo(int i)
|
64
|
+
# {
|
65
|
+
# if (i == 0)
|
66
|
+
# {
|
67
|
+
# return 0;
|
68
|
+
# }
|
69
|
+
# return i;
|
70
|
+
# }
|
71
|
+
indent_style: "K&R"
|
72
|
+
|
73
|
+
# Appearance width of a TAB character.
|
74
|
+
tab_width: 8
|
75
|
+
|
76
|
+
# Appearance width of 1-level of the indentation.
|
77
|
+
indent_width: 4
|
78
|
+
|
79
|
+
# Encoding of source files.
|
80
|
+
file_encoding:
|
81
|
+
|
82
|
+
#
|
83
|
+
# Compiler specific traits section
|
84
|
+
#
|
85
|
+
compiler_traits:
|
86
|
+
|
87
|
+
# Pathname of the compiler specific initial header file.
|
88
|
+
# This header file is automatically included above the first line of the
|
89
|
+
# project specific initial header file.
|
90
|
+
initial_header: "<%= cinit_fpath.basename %>"
|
91
|
+
|
92
|
+
#
|
93
|
+
# Compiler specific standard type section
|
94
|
+
#
|
95
|
+
standard_type:
|
96
|
+
|
97
|
+
# Bit size of the `char' type family.
|
98
|
+
char_size: 8
|
99
|
+
# Bit size of the alignment of the `char' type family.
|
100
|
+
char_alignment: 8
|
101
|
+
|
102
|
+
# Bit size of the `short' type family.
|
103
|
+
short_size: 16
|
104
|
+
# Bit size of the alignment of the `short' type family.
|
105
|
+
short_alignment: 16
|
106
|
+
|
107
|
+
# Bit size of the `int' type family.
|
108
|
+
int_size: 32
|
109
|
+
# Bit size of the alignment of the `int' type family.
|
110
|
+
int_alignment: 32
|
111
|
+
|
112
|
+
# Bit size of the `long int' type family.
|
113
|
+
long_size: 32
|
114
|
+
# Bit size of the alignment of the `long int' type family.
|
115
|
+
long_alignment: 32
|
116
|
+
|
117
|
+
# Bit size of the `long long int' type family.
|
118
|
+
long_long_size: 64
|
119
|
+
# Bit size of the alignment of the `long long int' type family.
|
120
|
+
long_long_alignment: 64
|
121
|
+
|
122
|
+
# Bit size of the `float' type.
|
123
|
+
float_size: 32
|
124
|
+
# Bit size of the alignment of the `float' type.
|
125
|
+
float_alignment: 32
|
126
|
+
|
127
|
+
# Bit size of the `double' type.
|
128
|
+
double_size: 64
|
129
|
+
# Bit size of the alignment of the `double' type.
|
130
|
+
double_alignment: 64
|
131
|
+
|
132
|
+
# Bit size of the `long double' type.
|
133
|
+
long_double_size: 96
|
134
|
+
# Bit size of the alignment of the `long double' type.
|
135
|
+
long_double_alignment: 96
|
136
|
+
|
137
|
+
# Bit size of the pointer to functions.
|
138
|
+
code_ptr_size: 32
|
139
|
+
# Bit size of the alignment of the pointer to functions.
|
140
|
+
code_ptr_alignment: 32
|
141
|
+
|
142
|
+
# Bit size of the pointer to data.
|
143
|
+
data_ptr_size: 32
|
144
|
+
# Bit size of the alignment of the pointer to data.
|
145
|
+
data_ptr_alignment: 32
|
146
|
+
|
147
|
+
# Treat the `char' type as same as the `unsigned char' type?
|
148
|
+
char_as_unsigned_char: true
|
149
|
+
|
150
|
+
# Compiler specific include paths.
|
151
|
+
# Ex.
|
152
|
+
# include_path:
|
153
|
+
# - "/usr/include"
|
154
|
+
# - "/usr/local/include"
|
155
|
+
include_path:
|
156
|
+
|
157
|
+
# Treat the `>>' operator as a logical shift, not an arithmetic shift?
|
158
|
+
arithmetic:
|
159
|
+
logical_right_shift: true
|
160
|
+
|
161
|
+
# Token substitution setting to warn the use of compiler specific extensions.
|
162
|
+
#
|
163
|
+
# If your compiler supports `__attribute__(...)' extension and you want to
|
164
|
+
# know the use of this extension, specify as below.
|
165
|
+
# extension_substitution:
|
166
|
+
# "__attribute__(__adlint__any)": ""
|
167
|
+
# The token sequence consists of `__attribute__', `(', any kind of tokens,
|
168
|
+
# `)' will be replaced with nothing (erased) after the preprocessing phase.
|
169
|
+
# And this substitution will be warned by the message W0061.
|
170
|
+
extension_substitution:
|
171
|
+
|
172
|
+
# Token substitution setting to silently ignore the use of compiler specific
|
173
|
+
# extensions.
|
174
|
+
#
|
175
|
+
# If your compiler supports `__asm__ volatile (...)' extension and you do not
|
176
|
+
# mind the use of this extension, specify as below.
|
177
|
+
# arbitrary_substitution:
|
178
|
+
# "__asm__ __adlint__any(__adlint__any)": ""
|
179
|
+
# The token sequence consists of `__asm__', any kind of tokens, `(', any kind
|
180
|
+
# of tokens, `)' will be replaced with nothing (erased) silently after the
|
181
|
+
# preprocessing phase.
|
182
|
+
arbitrary_substitution:
|
183
|
+
"typeof": "__typeof__"
|
184
|
+
"__typeof": "__typeof__"
|
185
|
+
"alignof": "__alignof__"
|
186
|
+
"__alignof": "__alignof__"
|
187
|
+
|
188
|
+
# Max length of all symbols can be identified by the compiler.
|
189
|
+
identifier_max: 128
|
190
|
+
|
191
|
+
#
|
192
|
+
# Linker specific traits section
|
193
|
+
#
|
194
|
+
linker_traits:
|
195
|
+
|
196
|
+
# Max length of external symbols can be identified by the linker.
|
197
|
+
identifier_max: 128
|
198
|
+
|
199
|
+
# Are external symbols identified without case by the linker?
|
200
|
+
identifier_ignore_case: false
|
201
|
+
|
202
|
+
#
|
203
|
+
# Message traits section
|
204
|
+
#
|
205
|
+
message_traits:
|
206
|
+
|
207
|
+
# Language of the message text.
|
208
|
+
# Currently, "en_US" and "ja_JP" are supported.
|
209
|
+
# Please help to translate the message catalog into your language.
|
210
|
+
language: "<%= lang %>"
|
211
|
+
|
212
|
+
# Message text replacement.
|
213
|
+
# Ex.
|
214
|
+
# change_list:
|
215
|
+
# W9999: "Your custom message for the warning of #9999."
|
216
|
+
change_list:
|