adlint 3.2.0 → 3.2.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/AUTHORS +1 -2
- data/ChangeLog +196 -5236
- data/INSTALL +1 -1
- data/MANIFEST +4 -2
- data/NEWS +30 -13
- data/README +2 -2
- data/Rakefile +2 -2
- data/TODO +1 -1
- data/bin/adlint +2 -2
- data/bin/adlint_chk +2 -2
- data/bin/adlint_cma +2 -2
- data/bin/adlint_sma +2 -2
- data/bin/adlintize +2 -2
- data/etc/conf.d/fallback/cinit.erb +1 -1
- data/etc/conf.d/fallback/traits.erb +1 -1
- data/etc/conf.d/i686-cygwin/cinit-gcc_4.3.4.erb +1 -1
- data/etc/conf.d/i686-cygwin/traits-gcc_4.3.4.erb +1 -1
- data/etc/conf.d/i686-devkit/cinit-gcc_4.5.2.erb +1 -1
- data/etc/conf.d/i686-devkit/traits-gcc_4.5.2.erb +1 -1
- data/etc/conf.d/i686-linux/cinit-gcc_4.5.1.erb +1 -1
- data/etc/conf.d/i686-linux/traits-gcc_4.5.1.erb +1 -1
- data/etc/conf.d/i686-mingw/cinit-gcc_4.6.1.erb +1 -1
- data/etc/conf.d/i686-mingw/traits-gcc_4.6.1.erb +1 -1
- data/etc/conf.d/noarch/GNUmakefile.erb +1 -1
- data/etc/conf.d/noarch/adlint_all_bat.erb +1 -1
- data/etc/conf.d/noarch/adlint_all_sh.erb +1 -1
- data/etc/conf.d/noarch/pinit.erb +1 -1
- data/etc/conf.d/x86_64-centos_6.4/cinit-gcc_4.4.7.erb +150 -0
- data/etc/conf.d/x86_64-centos_6.4/traits-gcc_4.4.7.erb +290 -0
- data/etc/conf.d/x86_64-ubuntu_12.04/cinit-gcc_4.6.3.erb +1 -1
- data/etc/conf.d/x86_64-ubuntu_12.04/traits-gcc_4.6.3.erb +1 -1
- data/etc/mesg.d/c_builtin/en_US/messages.yml +2 -2
- data/etc/mesg.d/c_builtin/ja_JP/messages.yml +3 -3
- data/etc/mesg.d/core/en_US/messages.yml +6 -2
- data/etc/mesg.d/core/ja_JP/messages.yml +6 -2
- data/features/code_check/E0008.feature +122 -0
- data/features/code_check/E0016.feature +49 -0
- data/features/code_check/E0018.feature +99 -0
- data/features/code_check/W0460.feature +8 -8
- data/lib/adlint.rb +2 -2
- data/lib/adlint/analyzer.rb +2 -2
- data/lib/adlint/annot.rb +2 -2
- data/lib/adlint/cc1.rb +2 -2
- data/lib/adlint/cc1/branch.rb +2 -2
- data/lib/adlint/cc1/builtin.rb +2 -2
- data/lib/adlint/cc1/const.rb +2 -2
- data/lib/adlint/cc1/conv.rb +2 -2
- data/lib/adlint/cc1/ctrlexpr.rb +2 -2
- data/lib/adlint/cc1/domain.rb +2 -2
- data/lib/adlint/cc1/enum.rb +2 -2
- data/lib/adlint/cc1/environ.rb +2 -2
- data/lib/adlint/cc1/expr.rb +110 -48
- data/lib/adlint/cc1/format.rb +2 -2
- data/lib/adlint/cc1/interp.rb +46 -12
- data/lib/adlint/cc1/lexer.rb +44 -11
- data/lib/adlint/cc1/mediator.rb +16 -2
- data/lib/adlint/cc1/object.rb +2 -2
- data/lib/adlint/cc1/operator.rb +2 -2
- data/lib/adlint/cc1/option.rb +3 -3
- data/lib/adlint/cc1/parser.rb +1011 -999
- data/lib/adlint/cc1/parser.y +20 -11
- data/lib/adlint/cc1/phase.rb +2 -2
- data/lib/adlint/cc1/resolver.rb +2 -2
- data/lib/adlint/cc1/scanner.rb +2 -2
- data/lib/adlint/cc1/scope.rb +2 -2
- data/lib/adlint/cc1/seqp.rb +2 -2
- data/lib/adlint/cc1/syntax.rb +42 -10
- data/lib/adlint/cc1/trace.rb +2 -2
- data/lib/adlint/cc1/type.rb +72 -2
- data/lib/adlint/cc1/util.rb +2 -2
- data/lib/adlint/cc1/value.rb +9 -3
- data/lib/adlint/code.rb +2 -2
- data/lib/adlint/cpp.rb +2 -2
- data/lib/adlint/cpp/asm.rb +2 -2
- data/lib/adlint/cpp/constexpr.rb +1 -1
- data/lib/adlint/cpp/constexpr.y +2 -2
- data/lib/adlint/cpp/eval.rb +2 -2
- data/lib/adlint/cpp/lexer.rb +13 -3
- data/lib/adlint/cpp/macro.rb +2 -2
- data/lib/adlint/cpp/phase.rb +2 -2
- data/lib/adlint/cpp/scanner.rb +2 -2
- data/lib/adlint/cpp/source.rb +2 -2
- data/lib/adlint/cpp/subst.rb +6 -2
- data/lib/adlint/cpp/syntax.rb +2 -2
- data/lib/adlint/cpp/util.rb +2 -2
- data/lib/adlint/driver.rb +2 -2
- data/lib/adlint/error.rb +2 -2
- data/lib/adlint/exam.rb +20 -8
- data/lib/adlint/exam/c_builtin.rb +4 -6
- data/lib/adlint/exam/c_builtin/cc1_check.rb +1380 -461
- data/lib/adlint/exam/c_builtin/cc1_code.rb +25 -25
- data/lib/adlint/exam/c_builtin/cc1_metric.rb +180 -209
- data/lib/adlint/exam/c_builtin/cpp_check.rb +211 -50
- data/lib/adlint/exam/c_builtin/cpp_code.rb +19 -19
- data/lib/adlint/exam/c_builtin/ld_check.rb +2 -2
- data/lib/adlint/exam/c_builtin/ld_metric.rb +2 -2
- data/lib/adlint/lang.rb +2 -2
- data/lib/adlint/ld.rb +2 -2
- data/lib/adlint/ld/object.rb +3 -3
- data/lib/adlint/ld/phase.rb +2 -2
- data/lib/adlint/ld/typedef.rb +2 -2
- data/lib/adlint/ld/util.rb +2 -2
- data/lib/adlint/lexer.rb +2 -2
- data/lib/adlint/location.rb +2 -2
- data/lib/adlint/memo.rb +2 -2
- data/lib/adlint/message.rb +2 -2
- data/lib/adlint/metric.rb +2 -2
- data/lib/adlint/monitor.rb +2 -2
- data/lib/adlint/phase.rb +2 -2
- data/lib/adlint/prelude.rb +2 -2
- data/lib/adlint/report.rb +4 -4
- data/lib/adlint/source.rb +2 -2
- data/lib/adlint/supp.rb +2 -2
- data/lib/adlint/symbol.rb +2 -2
- data/lib/adlint/token.rb +2 -2
- data/lib/adlint/traits.rb +2 -2
- data/lib/adlint/util.rb +2 -2
- data/lib/adlint/version.rb +6 -6
- data/share/HEADER +2 -2
- data/share/doc/developers_guide_ja.html +20 -9
- data/share/doc/developers_guide_ja.texi +18 -7
- data/share/doc/samples/GNUmakefile +1 -1
- data/share/doc/samples/adlint_traits.yml +1 -1
- data/share/doc/users_guide_en.html +6177 -6138
- data/share/doc/users_guide_en.texi +35 -5
- data/share/doc/users_guide_ja.html +6192 -6153
- data/share/doc/users_guide_ja.texi +35 -5
- data/share/sample/bison-2.5/adlint/GNUmakefile +1 -1
- data/share/sample/bison-2.5/adlint/adlint_traits.yml +1 -1
- data/share/sample/bison-2.5/adlint/lib/GNUmakefile +1 -1
- data/share/sample/bison-2.5/adlint/lib/adlint_cinit.h +1 -1
- data/share/sample/bison-2.5/adlint/lib/adlint_pinit.h +1 -1
- data/share/sample/bison-2.5/adlint/lib/adlint_traits.yml +1 -1
- data/share/sample/bison-2.5/adlint/src/GNUmakefile +1 -1
- data/share/sample/bison-2.5/adlint/src/adlint_cinit.h +1 -1
- data/share/sample/bison-2.5/adlint/src/adlint_pinit.h +1 -1
- data/share/sample/bison-2.5/adlint/src/adlint_traits.yml +1 -1
- data/share/sample/ctags-5.8/adlint/GNUmakefile +1 -1
- data/share/sample/ctags-5.8/adlint/adlint_cinit.h +1 -1
- data/share/sample/ctags-5.8/adlint/adlint_pinit.h +1 -1
- data/share/sample/ctags-5.8/adlint/adlint_traits.yml +1 -1
- data/share/sample/flex-2.5.35/adlint/GNUmakefile +1 -1
- data/share/sample/flex-2.5.35/adlint/adlint_cinit.h +1 -1
- data/share/sample/flex-2.5.35/adlint/adlint_pinit.h +1 -1
- data/share/sample/flex-2.5.35/adlint/adlint_traits.yml +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/adlint_traits.yml +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/core/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/core/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/core/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/core/adlint_traits.yml +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/enc-trans/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/enc-trans/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/enc-trans/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/enc-trans/adlint_traits.yml +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/enc/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/enc/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/enc/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/enc/adlint_traits.yml +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-bigdecimal/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-bigdecimal/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-bigdecimal/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-bigdecimal/adlint_traits.yml +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-continuation/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-continuation/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-continuation/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-continuation/adlint_traits.yml +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-coverage/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-coverage/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-coverage/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-coverage/adlint_traits.yml +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-curses/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-curses/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-curses/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-curses/adlint_traits.yml +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-date/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-date/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-date/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-date/adlint_traits.yml +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-dbm/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-dbm/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-dbm/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-dbm/adlint_traits.yml +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-bubblebabble/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-bubblebabble/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-bubblebabble/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-bubblebabble/adlint_traits.yml +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-md5/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-md5/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-md5/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-md5/adlint_traits.yml +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-rmd160/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-rmd160/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-rmd160/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-rmd160/adlint_traits.yml +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-sha1/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-sha1/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-sha1/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-sha1/adlint_traits.yml +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-sha2/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-sha2/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-sha2/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-sha2/adlint_traits.yml +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest/adlint_traits.yml +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-dl-callback/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-dl-callback/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-dl-callback/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-dl-callback/adlint_traits.yml +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-dl/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-dl/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-dl/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-dl/adlint_traits.yml +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-etc/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-etc/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-etc/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-etc/adlint_traits.yml +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-fcntl/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-fcntl/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-fcntl/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-fcntl/adlint_traits.yml +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-fiber/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-fiber/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-fiber/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-fiber/adlint_traits.yml +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-fiddle/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-fiddle/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-fiddle/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-fiddle/adlint_traits.yml +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-gdbm/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-gdbm/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-gdbm/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-gdbm/adlint_traits.yml +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-iconv/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-iconv/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-iconv/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-iconv/adlint_traits.yml +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-io-console/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-io-console/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-io-console/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-io-console/adlint_traits.yml +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-io-nonblock/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-io-nonblock/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-io-nonblock/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-io-nonblock/adlint_traits.yml +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-io-wait/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-io-wait/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-io-wait/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-io-wait/adlint_traits.yml +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-json-generator/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-json-generator/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-json-generator/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-json-generator/adlint_traits.yml +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-json-parser/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-json-parser/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-json-parser/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-json-parser/adlint_traits.yml +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-mathn-complex/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-mathn-complex/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-mathn-complex/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-mathn-complex/adlint_traits.yml +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-mathn-rational/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-mathn-rational/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-mathn-rational/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-mathn-rational/adlint_traits.yml +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-nkf/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-nkf/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-nkf/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-nkf/adlint_traits.yml +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-openssl/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-openssl/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-openssl/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-openssl/adlint_traits.yml +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-pathname/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-pathname/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-pathname/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-pathname/adlint_traits.yml +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-psych/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-psych/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-psych/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-psych/adlint_traits.yml +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-pty/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-pty/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-pty/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-pty/adlint_traits.yml +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-racc-cparse/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-racc-cparse/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-racc-cparse/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-racc-cparse/adlint_traits.yml +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-readline/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-readline/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-readline/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-readline/adlint_traits.yml +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-ripper/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-ripper/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-ripper/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-ripper/adlint_traits.yml +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-sdbm/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-sdbm/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-sdbm/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-sdbm/adlint_traits.yml +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-socket/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-socket/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-socket/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-socket/adlint_traits.yml +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-stringio/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-stringio/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-stringio/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-stringio/adlint_traits.yml +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-strscan/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-strscan/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-strscan/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-strscan/adlint_traits.yml +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-syck/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-syck/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-syck/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-syck/adlint_traits.yml +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-syslog/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-syslog/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-syslog/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-syslog/adlint_traits.yml +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-zlib/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-zlib/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-zlib/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-zlib/adlint_traits.yml +1 -1
- data/share/sample/screen-4.0.3/adlint/GNUmakefile +1 -1
- data/share/sample/screen-4.0.3/adlint/adlint_cinit.h +1 -1
- data/share/sample/screen-4.0.3/adlint/adlint_pinit.h +1 -1
- data/share/sample/screen-4.0.3/adlint/adlint_traits.yml +1 -1
- data/share/sample/vim-7.3/adlint/vim/GNUmakefile +1 -1
- data/share/sample/vim-7.3/adlint/vim/adlint_cinit.h +1 -1
- data/share/sample/vim-7.3/adlint/vim/adlint_pinit.h +1 -1
- data/share/sample/vim-7.3/adlint/vim/adlint_traits.yml +1 -1
- data/share/sample/vim-7.3/adlint/xxd/GNUmakefile +1 -1
- data/share/sample/vim-7.3/adlint/xxd/adlint_cinit.h +1 -1
- data/share/sample/vim-7.3/adlint/xxd/adlint_pinit.h +1 -1
- data/share/sample/vim-7.3/adlint/xxd/adlint_traits.yml +1 -1
- data/share/sample/zsh-4.3.15/adlint/GNUmakefile +1 -1
- data/share/sample/zsh-4.3.15/adlint/adlint_traits.yml +1 -1
- data/share/sample/zsh-4.3.15/adlint/builtins/GNUmakefile +1 -1
- data/share/sample/zsh-4.3.15/adlint/builtins/adlint_cinit.h +1 -1
- data/share/sample/zsh-4.3.15/adlint/builtins/adlint_pinit.h +1 -1
- data/share/sample/zsh-4.3.15/adlint/builtins/adlint_traits.yml +1 -1
- data/share/sample/zsh-4.3.15/adlint/core/GNUmakefile +1 -1
- data/share/sample/zsh-4.3.15/adlint/core/adlint_cinit.h +1 -1
- data/share/sample/zsh-4.3.15/adlint/core/adlint_pinit.h +1 -1
- data/share/sample/zsh-4.3.15/adlint/core/adlint_traits.yml +1 -1
- data/share/sample/zsh-4.3.15/adlint/modules/GNUmakefile +1 -1
- data/share/sample/zsh-4.3.15/adlint/modules/adlint_cinit.h +1 -1
- data/share/sample/zsh-4.3.15/adlint/modules/adlint_pinit.h +1 -1
- data/share/sample/zsh-4.3.15/adlint/modules/adlint_traits.yml +1 -1
- data/share/sample/zsh-4.3.15/adlint/zle/GNUmakefile +1 -1
- data/share/sample/zsh-4.3.15/adlint/zle/adlint_cinit.h +1 -1
- data/share/sample/zsh-4.3.15/adlint/zle/adlint_pinit.h +1 -1
- data/share/sample/zsh-4.3.15/adlint/zle/adlint_traits.yml +1 -1
- data/spec/adlint/cc1/ctrlexpr_spec.rb +3 -3
- data/spec/adlint/cc1/domain_spec.rb +2 -2
- data/spec/adlint/cc1/operator_spec.rb +2 -2
- data/spec/adlint/cc1/syntax_spec.rb +4 -4
- data/spec/adlint/cc1/type_spec.rb +2 -2
- data/spec/adlint/location_spec.rb +2 -2
- data/spec/conf.d/default_traits.yml +1 -1
- data/spec/conf.d/empty_cinit.h +1 -1
- data/spec/conf.d/empty_pinit.h +1 -1
- data/spec/spec_helper.rb +2 -2
- metadata +29 -28
- data/lib/adlint/exam/c_builtin/cc1_check_shima.rb +0 -963
- data/lib/adlint/exam/c_builtin/cpp_check_shima.rb +0 -204
@@ -1,7 +1,7 @@
|
|
1
1
|
# Code checkings (cpp-phase) of adlint-exam-c_builtin package.
|
2
2
|
#
|
3
3
|
# Author:: Yutaka Yanoh <mailto:yanoh@users.sourceforge.net>
|
4
|
-
# Copyright:: Copyright (C) 2010-
|
4
|
+
# Copyright:: Copyright (C) 2010-2014, OGIS-RI Co.,Ltd.
|
5
5
|
# License:: GPLv3+: GNU General Public License version 3 or later
|
6
6
|
#
|
7
7
|
# Owner:: Yutaka Yanoh <mailto:yanoh@users.sourceforge.net>
|
@@ -11,7 +11,7 @@
|
|
11
11
|
# / | / _ |/ / / / | / /__ __/ Source Code Static Analyzer
|
12
12
|
# / /| | / / / / / / / |/ / / / AdLint - Advanced Lint
|
13
13
|
# / __ |/ /_/ / /___/ / /| / / /
|
14
|
-
# /_/ |_|_____/_____/_/_/ |_/ /_/ Copyright (C) 2010-
|
14
|
+
# /_/ |_|_____/_____/_/_/ |_/ /_/ Copyright (C) 2010-2014, OGIS-RI Co.,Ltd.
|
15
15
|
#
|
16
16
|
# This file is part of AdLint.
|
17
17
|
#
|
@@ -48,9 +48,9 @@ module CBuiltin #:nodoc:
|
|
48
48
|
|
49
49
|
def initialize(phase_ctxt)
|
50
50
|
super
|
51
|
-
|
52
|
-
|
53
|
-
|
51
|
+
trav = phase_ctxt[:cpp_ast_traversal]
|
52
|
+
trav.enter_grouped_expression += T(:enter_grouped_expression)
|
53
|
+
trav.leave_grouped_expression += T(:leave_grouped_expression)
|
54
54
|
@group_depth = 0
|
55
55
|
end
|
56
56
|
|
@@ -155,9 +155,9 @@ module CBuiltin #:nodoc:
|
|
155
155
|
|
156
156
|
def initialize(phase_ctxt)
|
157
157
|
super
|
158
|
-
|
159
|
-
|
160
|
-
|
158
|
+
trav = phase_ctxt[:cpp_ast_traversal]
|
159
|
+
trav.enter_if_section += T(:enter_if_section)
|
160
|
+
trav.leave_if_section += T(:leave_if_section)
|
161
161
|
@if_depth = 0
|
162
162
|
end
|
163
163
|
|
@@ -355,9 +355,9 @@ module CBuiltin #:nodoc:
|
|
355
355
|
|
356
356
|
def initialize(phase_ctxt)
|
357
357
|
super
|
358
|
-
|
359
|
-
|
360
|
-
|
358
|
+
trav = phase_ctxt[:cpp_ast_traversal]
|
359
|
+
trav.enter_user_include_line += T(:check_user_include_line)
|
360
|
+
trav.enter_system_include_line += T(:check_system_include_line)
|
361
361
|
end
|
362
362
|
|
363
363
|
private
|
@@ -383,11 +383,11 @@ module CBuiltin #:nodoc:
|
|
383
383
|
|
384
384
|
def initialize(phase_ctxt)
|
385
385
|
super
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
386
|
+
trav = phase_ctxt[:cpp_ast_traversal]
|
387
|
+
trav.enter_user_include_line += T(:enter_include_line)
|
388
|
+
trav.enter_system_include_line += T(:enter_include_line)
|
389
|
+
trav.enter_text_line += T(:enter_text_line)
|
390
|
+
trav.enter_if_section += T(:enter_if_section)
|
391
391
|
@main_fpath = phase_ctxt[:sources].first.fpath
|
392
392
|
@last_fpath = nil
|
393
393
|
@enclosed_by_if_section = false
|
@@ -496,9 +496,9 @@ module CBuiltin #:nodoc:
|
|
496
496
|
|
497
497
|
def initialize(phase_ctxt)
|
498
498
|
super
|
499
|
-
|
500
|
-
|
501
|
-
|
499
|
+
trav = phase_ctxt[:cpp_ast_traversal]
|
500
|
+
trav.enter_function_like_define_line += T(:check)
|
501
|
+
trav.enter_va_function_like_define_line += T(:check)
|
502
502
|
end
|
503
503
|
|
504
504
|
private
|
@@ -663,10 +663,10 @@ module CBuiltin #:nodoc:
|
|
663
663
|
|
664
664
|
def initialize(phase_ctxt)
|
665
665
|
super
|
666
|
-
|
667
|
-
|
668
|
-
|
669
|
-
|
666
|
+
trav = phase_ctxt[:cpp_ast_traversal]
|
667
|
+
trav.enter_object_like_define_line += T(:check)
|
668
|
+
trav.enter_function_like_define_line += T(:check)
|
669
|
+
trav.enter_va_function_like_define_line += T(:check)
|
670
670
|
end
|
671
671
|
|
672
672
|
private
|
@@ -693,8 +693,8 @@ module CBuiltin #:nodoc:
|
|
693
693
|
|
694
694
|
def initialize(phase_ctxt)
|
695
695
|
super
|
696
|
-
|
697
|
-
|
696
|
+
trav = phase_ctxt[:cpp_ast_traversal]
|
697
|
+
trav.enter_object_like_define_line += T(:check)
|
698
698
|
end
|
699
699
|
|
700
700
|
private
|
@@ -716,10 +716,10 @@ module CBuiltin #:nodoc:
|
|
716
716
|
|
717
717
|
def initialize(phase_ctxt)
|
718
718
|
super
|
719
|
-
|
720
|
-
|
721
|
-
|
722
|
-
|
719
|
+
trav = phase_ctxt[:cpp_ast_traversal]
|
720
|
+
trav.enter_object_like_define_line += T(:check)
|
721
|
+
trav.enter_function_like_define_line += T(:check)
|
722
|
+
trav.enter_va_function_like_define_line += T(:check)
|
723
723
|
end
|
724
724
|
|
725
725
|
private
|
@@ -741,10 +741,10 @@ module CBuiltin #:nodoc:
|
|
741
741
|
|
742
742
|
def initialize(phase_ctxt)
|
743
743
|
super
|
744
|
-
|
745
|
-
|
746
|
-
|
747
|
-
|
744
|
+
trav = phase_ctxt[:cpp_ast_traversal]
|
745
|
+
trav.enter_object_like_define_line += T(:check)
|
746
|
+
trav.enter_function_like_define_line += T(:check)
|
747
|
+
trav.enter_va_function_like_define_line += T(:check)
|
748
748
|
end
|
749
749
|
|
750
750
|
private
|
@@ -764,8 +764,8 @@ module CBuiltin #:nodoc:
|
|
764
764
|
|
765
765
|
def initialize(phase_ctxt)
|
766
766
|
super
|
767
|
-
|
768
|
-
|
767
|
+
trav = phase_ctxt[:cpp_ast_traversal]
|
768
|
+
trav.enter_object_like_define_line += T(:check)
|
769
769
|
end
|
770
770
|
|
771
771
|
private
|
@@ -801,8 +801,8 @@ module CBuiltin #:nodoc:
|
|
801
801
|
|
802
802
|
def initialize(phase_ctxt)
|
803
803
|
super
|
804
|
-
|
805
|
-
|
804
|
+
trav = phase_ctxt[:cpp_ast_traversal]
|
805
|
+
trav.enter_object_like_define_line += T(:check)
|
806
806
|
end
|
807
807
|
|
808
808
|
private
|
@@ -1066,9 +1066,9 @@ module CBuiltin #:nodoc:
|
|
1066
1066
|
|
1067
1067
|
def initialize(phase_ctxt)
|
1068
1068
|
super
|
1069
|
-
|
1070
|
-
|
1071
|
-
|
1069
|
+
trav = phase_ctxt[:cpp_ast_traversal]
|
1070
|
+
trav.enter_system_include_line += T(:check)
|
1071
|
+
trav.enter_system_include_next_line += T(:check)
|
1072
1072
|
end
|
1073
1073
|
|
1074
1074
|
private
|
@@ -1088,9 +1088,9 @@ module CBuiltin #:nodoc:
|
|
1088
1088
|
|
1089
1089
|
def initialize(phase_ctxt)
|
1090
1090
|
super
|
1091
|
-
|
1092
|
-
|
1093
|
-
|
1091
|
+
trav = phase_ctxt[:cpp_ast_traversal]
|
1092
|
+
trav.enter_user_include_line += T(:check)
|
1093
|
+
trav.enter_user_include_next_line += T(:check)
|
1094
1094
|
end
|
1095
1095
|
|
1096
1096
|
private
|
@@ -1110,11 +1110,11 @@ module CBuiltin #:nodoc:
|
|
1110
1110
|
|
1111
1111
|
def initialize(phase_ctxt)
|
1112
1112
|
super
|
1113
|
-
|
1114
|
-
|
1115
|
-
|
1116
|
-
|
1117
|
-
|
1113
|
+
trav = phase_ctxt[:cpp_ast_traversal]
|
1114
|
+
trav.enter_user_include_line += T(:check)
|
1115
|
+
trav.enter_user_include_next_line += T(:check)
|
1116
|
+
trav.enter_system_include_line += T(:check)
|
1117
|
+
trav.enter_system_include_next_line += T(:check)
|
1118
1118
|
end
|
1119
1119
|
|
1120
1120
|
private
|
@@ -1144,6 +1144,94 @@ module CBuiltin #:nodoc:
|
|
1144
1144
|
end
|
1145
1145
|
end
|
1146
1146
|
|
1147
|
+
class W0687 < PassiveCodeCheck
|
1148
|
+
def_registrant_phase Cpp::Prepare2Phase
|
1149
|
+
|
1150
|
+
# NOTE: W0687 may be duplicative when the same header which causes this
|
1151
|
+
# warning is included twice or more.
|
1152
|
+
mark_as_unique
|
1153
|
+
|
1154
|
+
def initialize(phase_ctxt)
|
1155
|
+
super
|
1156
|
+
interp = phase_ctxt[:cpp_interpreter]
|
1157
|
+
interp.on_macro_undefined += T(:check)
|
1158
|
+
end
|
1159
|
+
|
1160
|
+
private
|
1161
|
+
def check(undef_line, *)
|
1162
|
+
if undef_line.identifier.value == "defined"
|
1163
|
+
W(undef_line.identifier.location)
|
1164
|
+
end
|
1165
|
+
end
|
1166
|
+
end
|
1167
|
+
|
1168
|
+
class W0688 < PassiveCodeCheck
|
1169
|
+
def_registrant_phase Cpp::Prepare2Phase
|
1170
|
+
|
1171
|
+
# NOTE: W0688 may be duplicative when the same header which causes this
|
1172
|
+
# warning is included twice or more.
|
1173
|
+
mark_as_unique
|
1174
|
+
|
1175
|
+
def initialize(phase_ctxt)
|
1176
|
+
super
|
1177
|
+
trav = phase_ctxt[:cpp_ast_traversal]
|
1178
|
+
trav.enter_line_line += T(:check)
|
1179
|
+
end
|
1180
|
+
|
1181
|
+
private
|
1182
|
+
def check(line_line)
|
1183
|
+
if line_no_arg = line_no_argument(line_line)
|
1184
|
+
line_no = Integer(line_no_arg.value)
|
1185
|
+
unless line_no > 0 && line_no < 32768
|
1186
|
+
W(line_no_arg.location)
|
1187
|
+
end
|
1188
|
+
end
|
1189
|
+
rescue
|
1190
|
+
end
|
1191
|
+
|
1192
|
+
def line_no_argument(line_line)
|
1193
|
+
line_line.pp_tokens ? line_line.pp_tokens.tokens.first : nil
|
1194
|
+
end
|
1195
|
+
end
|
1196
|
+
|
1197
|
+
class W0689 < W0688
|
1198
|
+
def_registrant_phase Cpp::Prepare2Phase
|
1199
|
+
|
1200
|
+
# NOTE: W0689 may be duplicative when the same header which causes this
|
1201
|
+
# warning is included twice or more.
|
1202
|
+
mark_as_unique
|
1203
|
+
|
1204
|
+
private
|
1205
|
+
def check(line_line)
|
1206
|
+
if fname_arg = file_name_argument(line_line)
|
1207
|
+
unless fname_arg.value =~ /\A".*"\z/
|
1208
|
+
W(fname_arg.location)
|
1209
|
+
end
|
1210
|
+
end
|
1211
|
+
end
|
1212
|
+
|
1213
|
+
def file_name_argument(line_line)
|
1214
|
+
line_line.pp_tokens ? line_line.pp_tokens.tokens[1] : nil
|
1215
|
+
end
|
1216
|
+
end
|
1217
|
+
|
1218
|
+
class W0690 < W0688
|
1219
|
+
def_registrant_phase Cpp::Prepare2Phase
|
1220
|
+
|
1221
|
+
# NOTE: W0690 may be duplicative when the same header which causes this
|
1222
|
+
# warning is included twice or more.
|
1223
|
+
mark_as_unique
|
1224
|
+
|
1225
|
+
private
|
1226
|
+
def check(line_line)
|
1227
|
+
if line_no_arg = line_no_argument(line_line)
|
1228
|
+
Integer(line_no_arg.value)
|
1229
|
+
end
|
1230
|
+
rescue
|
1231
|
+
W(line_no_arg.location)
|
1232
|
+
end
|
1233
|
+
end
|
1234
|
+
|
1147
1235
|
class W0691 < PassiveCodeCheck
|
1148
1236
|
def_registrant_phase Cpp::Prepare2Phase
|
1149
1237
|
|
@@ -1186,6 +1274,21 @@ module CBuiltin #:nodoc:
|
|
1186
1274
|
end
|
1187
1275
|
end
|
1188
1276
|
|
1277
|
+
class W0695 < W0687
|
1278
|
+
def_registrant_phase Cpp::Prepare2Phase
|
1279
|
+
|
1280
|
+
# NOTE: W0695 may be duplicative when the same header which causes this
|
1281
|
+
# warning is included twice or more.
|
1282
|
+
mark_as_unique
|
1283
|
+
|
1284
|
+
private
|
1285
|
+
def check(undef_line, *)
|
1286
|
+
if undef_line.identifier.value == "assert"
|
1287
|
+
W(undef_line.identifier.location)
|
1288
|
+
end
|
1289
|
+
end
|
1290
|
+
end
|
1291
|
+
|
1189
1292
|
class W0696 < PassiveCodeCheck
|
1190
1293
|
def_registrant_phase Cpp::Prepare2Phase
|
1191
1294
|
|
@@ -1238,6 +1341,64 @@ module CBuiltin #:nodoc:
|
|
1238
1341
|
end
|
1239
1342
|
end
|
1240
1343
|
|
1344
|
+
class W0806 < PassiveCodeCheck
|
1345
|
+
def_registrant_phase Cpp::Prepare2Phase
|
1346
|
+
|
1347
|
+
# NOTE: W0806 may be duplicative when the same header which causes this
|
1348
|
+
# warning is included twice or more.
|
1349
|
+
mark_as_unique
|
1350
|
+
|
1351
|
+
def initialize(phase_ctxt)
|
1352
|
+
super
|
1353
|
+
interp = phase_ctxt[:cpp_interpreter]
|
1354
|
+
interp.on_object_like_macro_defined += T(:check)
|
1355
|
+
end
|
1356
|
+
|
1357
|
+
private
|
1358
|
+
def check(define_line, *)
|
1359
|
+
if define_line.identifier.value == "defined"
|
1360
|
+
W(define_line.identifier.location)
|
1361
|
+
end
|
1362
|
+
end
|
1363
|
+
end
|
1364
|
+
|
1365
|
+
class W0807 < W0687
|
1366
|
+
def_registrant_phase Cpp::Prepare2Phase
|
1367
|
+
|
1368
|
+
# NOTE: W0807 may be duplicative when the same header which causes this
|
1369
|
+
# warning is included twice or more.
|
1370
|
+
mark_as_unique
|
1371
|
+
|
1372
|
+
private
|
1373
|
+
def check(undef_line, macro)
|
1374
|
+
if macro.kind_of?(Cpp::SpecialMacro)
|
1375
|
+
identifier = undef_line.identifier
|
1376
|
+
W(identifier.location, identifier.value)
|
1377
|
+
end
|
1378
|
+
end
|
1379
|
+
end
|
1380
|
+
|
1381
|
+
class W0808 < PassiveCodeCheck
|
1382
|
+
def_registrant_phase Cpp::Prepare2Phase
|
1383
|
+
|
1384
|
+
# NOTE: W0808 may be duplicative when the same header which causes this
|
1385
|
+
# warning is included twice or more.
|
1386
|
+
mark_as_unique
|
1387
|
+
|
1388
|
+
def initialize(phase_ctxt)
|
1389
|
+
super
|
1390
|
+
interp = phase_ctxt[:cpp_interpreter]
|
1391
|
+
interp.on_object_like_macro_defined += T(:check)
|
1392
|
+
@macro_tbl = phase_ctxt[:cpp_macro_table]
|
1393
|
+
end
|
1394
|
+
|
1395
|
+
private
|
1396
|
+
def check(define_line, *)
|
1397
|
+
id = define_line.identifier
|
1398
|
+
W(id.location, id.value) if @macro_tbl.lookup(id.value)
|
1399
|
+
end
|
1400
|
+
end
|
1401
|
+
|
1241
1402
|
class W0811 < PassiveCodeCheck
|
1242
1403
|
def_registrant_phase Cpp::Prepare2Phase
|
1243
1404
|
|
@@ -1327,8 +1488,8 @@ module CBuiltin #:nodoc:
|
|
1327
1488
|
|
1328
1489
|
def initialize(phase_ctxt)
|
1329
1490
|
super
|
1330
|
-
|
1331
|
-
|
1491
|
+
trav = phase_ctxt[:cpp_ast_traversal]
|
1492
|
+
trav.enter_unknown_directive += T(:check)
|
1332
1493
|
end
|
1333
1494
|
|
1334
1495
|
private
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# Code structure extractions (cpp-phase) of adlint-exam-c_builtin package.
|
2
2
|
#
|
3
3
|
# Author:: Yutaka Yanoh <mailto:yanoh@users.sourceforge.net>
|
4
|
-
# Copyright:: Copyright (C) 2010-
|
4
|
+
# Copyright:: Copyright (C) 2010-2014, OGIS-RI Co.,Ltd.
|
5
5
|
# License:: GPLv3+: GNU General Public License version 3 or later
|
6
6
|
#
|
7
7
|
# Owner:: Yutaka Yanoh <mailto:yanoh@users.sourceforge.net>
|
@@ -11,7 +11,7 @@
|
|
11
11
|
# / | / _ |/ / / / | / /__ __/ Source Code Static Analyzer
|
12
12
|
# / /| | / / / / / / / |/ / / / AdLint - Advanced Lint
|
13
13
|
# / __ |/ /_/ / /___/ / /| / / /
|
14
|
-
# /_/ |_|_____/_____/_/_/ |_/ /_/ Copyright (C) 2010-
|
14
|
+
# /_/ |_|_____/_____/_/_/ |_/ /_/ Copyright (C) 2010-2014, OGIS-RI Co.,Ltd.
|
15
15
|
#
|
16
16
|
# This file is part of AdLint.
|
17
17
|
#
|
@@ -102,23 +102,23 @@ module CBuiltin #:nodoc:
|
|
102
102
|
|
103
103
|
def initialize(phase_ctxt)
|
104
104
|
super
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
105
|
+
trav = phase_ctxt[:cpp_ast_traversal]
|
106
|
+
trav.enter_if_statement += T(:extract_if)
|
107
|
+
trav.enter_ifdef_statement += T(:extract_ifdef)
|
108
|
+
trav.enter_ifndef_statement += T(:extract_ifndef)
|
109
|
+
trav.enter_elif_statement += T(:extract_elif)
|
110
|
+
trav.enter_else_statement += T(:extract_else)
|
111
|
+
trav.enter_endif_line += T(:extract_endif)
|
112
|
+
trav.enter_user_include_line += T(:extract_usr_include)
|
113
|
+
trav.enter_system_include_line += T(:extract_sys_include)
|
114
|
+
trav.enter_object_like_define_line += T(:extract_define)
|
115
|
+
trav.enter_function_like_define_line += T(:extract_define)
|
116
|
+
trav.enter_va_function_like_define_line += T(:extract_define)
|
117
|
+
trav.enter_undef_line += T(:extract_undef)
|
118
|
+
trav.enter_line_line += T(:extract_line)
|
119
|
+
trav.enter_error_line += T(:extract_error)
|
120
|
+
trav.enter_pragma_line += T(:extract_pragma)
|
121
|
+
trav.enter_null_directive += T(:extract_null)
|
122
122
|
end
|
123
123
|
|
124
124
|
private
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# Code checkings (ld-phase) of adlint-exam-c_builtin package.
|
2
2
|
#
|
3
3
|
# Author:: Yutaka Yanoh <mailto:yanoh@users.sourceforge.net>
|
4
|
-
# Copyright:: Copyright (C) 2010-
|
4
|
+
# Copyright:: Copyright (C) 2010-2014, OGIS-RI Co.,Ltd.
|
5
5
|
# License:: GPLv3+: GNU General Public License version 3 or later
|
6
6
|
#
|
7
7
|
# Owner:: Yutaka Yanoh <mailto:yanoh@users.sourceforge.net>
|
@@ -11,7 +11,7 @@
|
|
11
11
|
# / | / _ |/ / / / | / /__ __/ Source Code Static Analyzer
|
12
12
|
# / /| | / / / / / / / |/ / / / AdLint - Advanced Lint
|
13
13
|
# / __ |/ /_/ / /___/ / /| / / /
|
14
|
-
# /_/ |_|_____/_____/_/_/ |_/ /_/ Copyright (C) 2010-
|
14
|
+
# /_/ |_|_____/_____/_/_/ |_/ /_/ Copyright (C) 2010-2014, OGIS-RI Co.,Ltd.
|
15
15
|
#
|
16
16
|
# This file is part of AdLint.
|
17
17
|
#
|