adlint 3.2.0 → 3.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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
data/lib/adlint/cc1/parser.y
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# The ISO C99 parser.
|
|
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
|
#
|
|
@@ -579,6 +579,12 @@ global_declaration
|
|
|
579
579
|
result.head_token = val[0].first.head_token
|
|
580
580
|
result.tail_token = val[1]
|
|
581
581
|
}
|
|
582
|
+
| ";"
|
|
583
|
+
{
|
|
584
|
+
# NOTE: To accept extra semicolons in the global scope.
|
|
585
|
+
E(:E0018, val[0].location)
|
|
586
|
+
result = nil
|
|
587
|
+
}
|
|
582
588
|
;
|
|
583
589
|
|
|
584
590
|
declaration_specifiers
|
|
@@ -645,11 +651,13 @@ init_declarator_list
|
|
|
645
651
|
: init_declarator
|
|
646
652
|
{
|
|
647
653
|
checkpoint(val[0].location)
|
|
654
|
+
@lexer.disable_identifier_translation
|
|
648
655
|
result = val
|
|
649
656
|
}
|
|
650
657
|
| init_declarator_list "," init_declarator
|
|
651
658
|
{
|
|
652
659
|
checkpoint(val[0].first.location)
|
|
660
|
+
@lexer.disable_identifier_translation
|
|
653
661
|
result = val[0].push(val[2])
|
|
654
662
|
}
|
|
655
663
|
;
|
|
@@ -658,14 +666,14 @@ init_declarator
|
|
|
658
666
|
: declarator
|
|
659
667
|
{
|
|
660
668
|
checkpoint(val[0].location)
|
|
661
|
-
result = InitDeclarator.new(val[0], nil)
|
|
669
|
+
result = InitDeclarator.new(val[0], nil, nil)
|
|
662
670
|
result.head_token = val[0].head_token
|
|
663
671
|
result.tail_token = val[0].tail_token
|
|
664
672
|
}
|
|
665
673
|
| declarator "=" initializer
|
|
666
674
|
{
|
|
667
675
|
checkpoint(val[0].location)
|
|
668
|
-
result = InitDeclarator.new(val[0], val[2])
|
|
676
|
+
result = InitDeclarator.new(val[0], val[2], val[1])
|
|
669
677
|
result.head_token = val[0].head_token
|
|
670
678
|
result.tail_token = val[2].tail_token
|
|
671
679
|
}
|
|
@@ -834,28 +842,28 @@ struct_or_union_specifier
|
|
|
834
842
|
| STRUCT "{" struct_declaration_list "}"
|
|
835
843
|
{
|
|
836
844
|
checkpoint(val[0].location)
|
|
837
|
-
result = StructSpecifier.new(create_anon_tag_name(val[0]), val[2])
|
|
845
|
+
result = StructSpecifier.new(create_anon_tag_name(val[0]), val[2], true)
|
|
838
846
|
result.head_token = val[0]
|
|
839
847
|
result.tail_token = val[3]
|
|
840
848
|
}
|
|
841
849
|
| STRUCT "{" "}"
|
|
842
850
|
{
|
|
843
851
|
checkpoint(val[0].location)
|
|
844
|
-
result = StructSpecifier.new(create_anon_tag_name(val[0]), [])
|
|
852
|
+
result = StructSpecifier.new(create_anon_tag_name(val[0]), [], true)
|
|
845
853
|
result.head_token = val[0]
|
|
846
854
|
result.tail_token = val[2]
|
|
847
855
|
}
|
|
848
856
|
| UNION "{" struct_declaration_list "}"
|
|
849
857
|
{
|
|
850
858
|
checkpoint(val[0].location)
|
|
851
|
-
result = UnionSpecifier.new(create_anon_tag_name(val[0]), val[2])
|
|
859
|
+
result = UnionSpecifier.new(create_anon_tag_name(val[0]), val[2], true)
|
|
852
860
|
result.head_token = val[0]
|
|
853
861
|
result.tail_token = val[3]
|
|
854
862
|
}
|
|
855
863
|
| UNION "{" "}"
|
|
856
864
|
{
|
|
857
865
|
checkpoint(val[0].location)
|
|
858
|
-
result = UnionSpecifier.new(create_anon_tag_name(val[0]), [])
|
|
866
|
+
result = UnionSpecifier.new(create_anon_tag_name(val[0]), [], true)
|
|
859
867
|
result.head_token = val[0]
|
|
860
868
|
result.tail_token = val[2]
|
|
861
869
|
}
|
|
@@ -982,7 +990,8 @@ enum_specifier
|
|
|
982
990
|
: ENUM "{" enumerator_list "}"
|
|
983
991
|
{
|
|
984
992
|
checkpoint(val[0].location)
|
|
985
|
-
result = EnumSpecifier.new(create_anon_tag_name(val[0]),
|
|
993
|
+
result = EnumSpecifier.new(create_anon_tag_name(val[0]),
|
|
994
|
+
val[2], nil, true)
|
|
986
995
|
result.head_token = val[0]
|
|
987
996
|
result.tail_token = val[3]
|
|
988
997
|
result.enumerators.each do |enum|
|
|
@@ -1003,7 +1012,7 @@ enum_specifier
|
|
|
1003
1012
|
{
|
|
1004
1013
|
checkpoint(val[0].location)
|
|
1005
1014
|
result = EnumSpecifier.new(create_anon_tag_name(val[0]),
|
|
1006
|
-
val[2], val[3])
|
|
1015
|
+
val[2], val[3], true)
|
|
1007
1016
|
result.head_token = val[0]
|
|
1008
1017
|
result.tail_token = val[4]
|
|
1009
1018
|
result.enumerators.each do |enum|
|
|
@@ -1735,7 +1744,7 @@ translation_unit
|
|
|
1735
1744
|
{
|
|
1736
1745
|
checkpoint(val[0].location)
|
|
1737
1746
|
result = val[0]
|
|
1738
|
-
result.push(val[1])
|
|
1747
|
+
val[1] and result.push(val[1])
|
|
1739
1748
|
}
|
|
1740
1749
|
;
|
|
1741
1750
|
|
data/lib/adlint/cc1/phase.rb
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Analysis phases for C language.
|
|
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
|
#
|
data/lib/adlint/cc1/resolver.rb
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# C type resolver.
|
|
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
|
#
|
data/lib/adlint/cc1/scanner.rb
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Scanner for C language.
|
|
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
|
#
|
data/lib/adlint/cc1/scope.rb
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# C runtime scope.
|
|
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
|
#
|
data/lib/adlint/cc1/seqp.rb
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Sequence points of C language evaluation.
|
|
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
|
#
|
data/lib/adlint/cc1/syntax.rb
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# AST of C language.
|
|
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
|
#
|
|
@@ -2692,14 +2692,16 @@ module Cc1 #:nodoc:
|
|
|
2692
2692
|
end
|
|
2693
2693
|
|
|
2694
2694
|
class InitDeclarator < SyntaxNode
|
|
2695
|
-
def initialize(dcr, init)
|
|
2695
|
+
def initialize(dcr, init, equals_sign)
|
|
2696
2696
|
super()
|
|
2697
2697
|
@declarator = dcr
|
|
2698
2698
|
@initializer = init
|
|
2699
|
+
@equals_sign = equals_sign
|
|
2699
2700
|
end
|
|
2700
2701
|
|
|
2701
2702
|
attr_reader :declarator
|
|
2702
2703
|
attr_reader :initializer
|
|
2704
|
+
attr_reader :equals_sign
|
|
2703
2705
|
|
|
2704
2706
|
def location
|
|
2705
2707
|
@declarator.identifier.location
|
|
@@ -2764,10 +2766,11 @@ module Cc1 #:nodoc:
|
|
|
2764
2766
|
end
|
|
2765
2767
|
|
|
2766
2768
|
class StructSpecifier < TypeSpecifier
|
|
2767
|
-
def initialize(id, struct_dcls)
|
|
2769
|
+
def initialize(id, struct_dcls, anonymous = false)
|
|
2768
2770
|
super()
|
|
2769
2771
|
@identifier = id
|
|
2770
2772
|
@struct_declarations = struct_dcls
|
|
2773
|
+
@anonymous = anonymous
|
|
2771
2774
|
end
|
|
2772
2775
|
|
|
2773
2776
|
attr_reader :identifier
|
|
@@ -2777,13 +2780,17 @@ module Cc1 #:nodoc:
|
|
|
2777
2780
|
@identifier.location
|
|
2778
2781
|
end
|
|
2779
2782
|
|
|
2783
|
+
def anonymous?
|
|
2784
|
+
@anonymous
|
|
2785
|
+
end
|
|
2786
|
+
|
|
2780
2787
|
def to_s
|
|
2781
2788
|
if @struct_declarations
|
|
2782
2789
|
if @struct_declarations.empty?
|
|
2783
2790
|
"struct #{identifier.value} {}"
|
|
2784
2791
|
else
|
|
2785
2792
|
"struct #{identifier.value} { " +
|
|
2786
|
-
@struct_declarations.map { |
|
|
2793
|
+
@struct_declarations.map { |dcl| dcl.to_s }.join(" ") + " }"
|
|
2787
2794
|
end
|
|
2788
2795
|
else
|
|
2789
2796
|
"struct #{identifier.value}"
|
|
@@ -2796,10 +2803,11 @@ module Cc1 #:nodoc:
|
|
|
2796
2803
|
end
|
|
2797
2804
|
|
|
2798
2805
|
class UnionSpecifier < TypeSpecifier
|
|
2799
|
-
def initialize(id, struct_dcls)
|
|
2806
|
+
def initialize(id, struct_dcls, anonymous = false)
|
|
2800
2807
|
super()
|
|
2801
2808
|
@identifier = id
|
|
2802
2809
|
@struct_declarations = struct_dcls
|
|
2810
|
+
@anonymous = anonymous
|
|
2803
2811
|
end
|
|
2804
2812
|
|
|
2805
2813
|
attr_reader :identifier
|
|
@@ -2809,13 +2817,17 @@ module Cc1 #:nodoc:
|
|
|
2809
2817
|
@identifier.location
|
|
2810
2818
|
end
|
|
2811
2819
|
|
|
2820
|
+
def anonymous?
|
|
2821
|
+
@anonymous
|
|
2822
|
+
end
|
|
2823
|
+
|
|
2812
2824
|
def to_s
|
|
2813
2825
|
if @struct_declarations
|
|
2814
2826
|
if @struct_declarations.empty?
|
|
2815
2827
|
"union #{identifier.value} {}"
|
|
2816
2828
|
else
|
|
2817
2829
|
"union #{identifier.value} { " +
|
|
2818
|
-
@struct_declarations.map { |
|
|
2830
|
+
@struct_declarations.map { |dcl| dcl.to_s }.join(" ") +
|
|
2819
2831
|
" }"
|
|
2820
2832
|
end
|
|
2821
2833
|
else
|
|
@@ -2936,11 +2948,12 @@ module Cc1 #:nodoc:
|
|
|
2936
2948
|
end
|
|
2937
2949
|
|
|
2938
2950
|
class EnumSpecifier < TypeSpecifier
|
|
2939
|
-
def initialize(id, enums, trailing_comma = nil)
|
|
2951
|
+
def initialize(id, enums, trailing_comma = nil, anonymous = false)
|
|
2940
2952
|
super()
|
|
2941
2953
|
@identifier = id
|
|
2942
2954
|
@enumerators = enums
|
|
2943
2955
|
@trailing_comma = trailing_comma
|
|
2956
|
+
@anonymous = anonymous
|
|
2944
2957
|
end
|
|
2945
2958
|
|
|
2946
2959
|
attr_reader :identifier
|
|
@@ -2951,6 +2964,10 @@ module Cc1 #:nodoc:
|
|
|
2951
2964
|
@identifier.location
|
|
2952
2965
|
end
|
|
2953
2966
|
|
|
2967
|
+
def anonymous?
|
|
2968
|
+
@anonymous
|
|
2969
|
+
end
|
|
2970
|
+
|
|
2954
2971
|
def to_s
|
|
2955
2972
|
if @enumerators
|
|
2956
2973
|
if @enumerators.empty?
|
|
@@ -4102,7 +4119,7 @@ module Cc1 #:nodoc:
|
|
|
4102
4119
|
end
|
|
4103
4120
|
|
|
4104
4121
|
def implicit_parameter_definition(id, sym_tbl)
|
|
4105
|
-
init_dcr = InitDeclarator.new(IdentifierDeclarator.new(id), nil)
|
|
4122
|
+
init_dcr = InitDeclarator.new(IdentifierDeclarator.new(id), nil, nil)
|
|
4106
4123
|
Declaration.new(nil, [init_dcr], sym_tbl)
|
|
4107
4124
|
end
|
|
4108
4125
|
end
|
|
@@ -4174,7 +4191,7 @@ module Cc1 #:nodoc:
|
|
|
4174
4191
|
|
|
4175
4192
|
def to_variable_definition
|
|
4176
4193
|
PseudoVariableDefinition.new(declaration_specifiers,
|
|
4177
|
-
InitDeclarator.new(@declarator, nil),
|
|
4194
|
+
InitDeclarator.new(@declarator, nil, nil),
|
|
4178
4195
|
type)
|
|
4179
4196
|
end
|
|
4180
4197
|
|
|
@@ -5579,6 +5596,21 @@ module Cc1 #:nodoc:
|
|
|
5579
5596
|
# NOTE: To treat address of variables as an address-constant.
|
|
5580
5597
|
end
|
|
5581
5598
|
|
|
5599
|
+
def visit_comma_separated_expression(node)
|
|
5600
|
+
# NOTE: A constant-expression should not contain comma-operators.
|
|
5601
|
+
#
|
|
5602
|
+
# NOTE: The ISO C99 standard says;
|
|
5603
|
+
#
|
|
5604
|
+
# 6.6 Constant expressions
|
|
5605
|
+
#
|
|
5606
|
+
# Constraints
|
|
5607
|
+
#
|
|
5608
|
+
# 3 Constant expressions shall not contain assignment, increment,
|
|
5609
|
+
# decrement, function-call, or comma operators, except when they are
|
|
5610
|
+
# contained within a subexpression that is not evaluated.
|
|
5611
|
+
break_as_inconstant
|
|
5612
|
+
end
|
|
5613
|
+
|
|
5582
5614
|
def break_as_inconstant(*)
|
|
5583
5615
|
throw(:constancy, false)
|
|
5584
5616
|
end
|
data/lib/adlint/cc1/trace.rb
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Context tracer.
|
|
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
|
#
|
data/lib/adlint/cc1/type.rb
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# C type models.
|
|
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
|
#
|
|
@@ -164,6 +164,10 @@ module Cc1 #:nodoc:
|
|
|
164
164
|
subclass_responsibility
|
|
165
165
|
end
|
|
166
166
|
|
|
167
|
+
def named?
|
|
168
|
+
subclass_responsibility
|
|
169
|
+
end
|
|
170
|
+
|
|
167
171
|
def bit_size
|
|
168
172
|
subclass_responsibility
|
|
169
173
|
end
|
|
@@ -670,6 +674,10 @@ module Cc1 #:nodoc:
|
|
|
670
674
|
nil
|
|
671
675
|
end
|
|
672
676
|
|
|
677
|
+
def named?
|
|
678
|
+
false
|
|
679
|
+
end
|
|
680
|
+
|
|
673
681
|
def bit_size
|
|
674
682
|
0
|
|
675
683
|
end
|
|
@@ -1181,6 +1189,10 @@ module Cc1 #:nodoc:
|
|
|
1181
1189
|
nil
|
|
1182
1190
|
end
|
|
1183
1191
|
|
|
1192
|
+
def named?
|
|
1193
|
+
false
|
|
1194
|
+
end
|
|
1195
|
+
|
|
1184
1196
|
def bit_size
|
|
1185
1197
|
0
|
|
1186
1198
|
end
|
|
@@ -1696,6 +1708,7 @@ module Cc1 #:nodoc:
|
|
|
1696
1708
|
|
|
1697
1709
|
def_delegator :@base_type, :declarations
|
|
1698
1710
|
def_delegator :@base_type, :location
|
|
1711
|
+
def_delegator :@base_type, :named?
|
|
1699
1712
|
def_delegator :@base_type, :bit_size
|
|
1700
1713
|
def_delegator :@base_type, :bit_alignment
|
|
1701
1714
|
|
|
@@ -1917,6 +1930,10 @@ module Cc1 #:nodoc:
|
|
|
1917
1930
|
nil
|
|
1918
1931
|
end
|
|
1919
1932
|
|
|
1933
|
+
def named?
|
|
1934
|
+
true
|
|
1935
|
+
end
|
|
1936
|
+
|
|
1920
1937
|
def bit_size
|
|
1921
1938
|
0
|
|
1922
1939
|
end
|
|
@@ -2433,6 +2450,10 @@ module Cc1 #:nodoc:
|
|
|
2433
2450
|
nil
|
|
2434
2451
|
end
|
|
2435
2452
|
|
|
2453
|
+
def named?
|
|
2454
|
+
true
|
|
2455
|
+
end
|
|
2456
|
+
|
|
2436
2457
|
def bit_size
|
|
2437
2458
|
0
|
|
2438
2459
|
end
|
|
@@ -2993,6 +3014,10 @@ module Cc1 #:nodoc:
|
|
|
2993
3014
|
subclass_responsibility
|
|
2994
3015
|
end
|
|
2995
3016
|
|
|
3017
|
+
def named?
|
|
3018
|
+
subclass_responsibility
|
|
3019
|
+
end
|
|
3020
|
+
|
|
2996
3021
|
def real_type
|
|
2997
3022
|
self
|
|
2998
3023
|
end
|
|
@@ -3539,6 +3564,10 @@ module Cc1 #:nodoc:
|
|
|
3539
3564
|
subclass_responsibility
|
|
3540
3565
|
end
|
|
3541
3566
|
|
|
3567
|
+
def named?
|
|
3568
|
+
true
|
|
3569
|
+
end
|
|
3570
|
+
|
|
3542
3571
|
def incomplete?
|
|
3543
3572
|
false
|
|
3544
3573
|
end
|
|
@@ -4821,6 +4850,10 @@ module Cc1 #:nodoc:
|
|
|
4821
4850
|
@id ||= BitfieldTypeId.new(@base_type, bit_size)
|
|
4822
4851
|
end
|
|
4823
4852
|
|
|
4853
|
+
def named?
|
|
4854
|
+
true
|
|
4855
|
+
end
|
|
4856
|
+
|
|
4824
4857
|
def incomplete?
|
|
4825
4858
|
@base_type.incomplete?
|
|
4826
4859
|
end
|
|
@@ -4939,6 +4972,10 @@ module Cc1 #:nodoc:
|
|
|
4939
4972
|
@id ||= EnumTypeId.new(name)
|
|
4940
4973
|
end
|
|
4941
4974
|
|
|
4975
|
+
def named?
|
|
4976
|
+
declarations.all? { |dcl| !dcl.enum_specifier.anonymous? }
|
|
4977
|
+
end
|
|
4978
|
+
|
|
4942
4979
|
def incomplete?
|
|
4943
4980
|
declarations.all? { |dcl| dcl.enumerators.nil? }
|
|
4944
4981
|
end
|
|
@@ -5071,6 +5108,10 @@ module Cc1 #:nodoc:
|
|
|
5071
5108
|
create_brief_image(@base_type)
|
|
5072
5109
|
end
|
|
5073
5110
|
|
|
5111
|
+
def named?
|
|
5112
|
+
true
|
|
5113
|
+
end
|
|
5114
|
+
|
|
5074
5115
|
def real_type
|
|
5075
5116
|
type_table.pointer_type(@base_type.real_type)
|
|
5076
5117
|
end
|
|
@@ -5348,6 +5389,10 @@ module Cc1 #:nodoc:
|
|
|
5348
5389
|
@id ||= FloatTypeId.new
|
|
5349
5390
|
end
|
|
5350
5391
|
|
|
5392
|
+
def named?
|
|
5393
|
+
true
|
|
5394
|
+
end
|
|
5395
|
+
|
|
5351
5396
|
def argument_promoted_type
|
|
5352
5397
|
# NOTE: The ISO C99 standard says;
|
|
5353
5398
|
#
|
|
@@ -5516,6 +5561,10 @@ module Cc1 #:nodoc:
|
|
|
5516
5561
|
nil
|
|
5517
5562
|
end
|
|
5518
5563
|
|
|
5564
|
+
def named?
|
|
5565
|
+
true
|
|
5566
|
+
end
|
|
5567
|
+
|
|
5519
5568
|
def bit_size
|
|
5520
5569
|
@length ? @base_type.bit_size * @length : 0
|
|
5521
5570
|
end
|
|
@@ -6110,6 +6159,10 @@ module Cc1 #:nodoc:
|
|
|
6110
6159
|
subclass_responsibility
|
|
6111
6160
|
end
|
|
6112
6161
|
|
|
6162
|
+
def named?
|
|
6163
|
+
subclass_responsibility
|
|
6164
|
+
end
|
|
6165
|
+
|
|
6113
6166
|
def bit_size
|
|
6114
6167
|
@members.reduce(0) { |sum, memb| sum + memb.type.bit_size }
|
|
6115
6168
|
end
|
|
@@ -6661,6 +6714,10 @@ module Cc1 #:nodoc:
|
|
|
6661
6714
|
"struct #{name}"
|
|
6662
6715
|
end
|
|
6663
6716
|
|
|
6717
|
+
def named?
|
|
6718
|
+
declarations.all? { |dcl| !dcl.struct_specifier.anonymous? }
|
|
6719
|
+
end
|
|
6720
|
+
|
|
6664
6721
|
def struct?
|
|
6665
6722
|
true
|
|
6666
6723
|
end
|
|
@@ -6700,6 +6757,10 @@ module Cc1 #:nodoc:
|
|
|
6700
6757
|
"union #{name}"
|
|
6701
6758
|
end
|
|
6702
6759
|
|
|
6760
|
+
def named?
|
|
6761
|
+
declarations.all? { |dcl| !dcl.union_specifier.anonymous? }
|
|
6762
|
+
end
|
|
6763
|
+
|
|
6703
6764
|
def struct?
|
|
6704
6765
|
false
|
|
6705
6766
|
end
|
|
@@ -6742,6 +6803,10 @@ module Cc1 #:nodoc:
|
|
|
6742
6803
|
name
|
|
6743
6804
|
end
|
|
6744
6805
|
|
|
6806
|
+
def named?
|
|
6807
|
+
true
|
|
6808
|
+
end
|
|
6809
|
+
|
|
6745
6810
|
def_delegator :@base_type, :bit_size
|
|
6746
6811
|
def_delegator :@base_type, :bit_alignment
|
|
6747
6812
|
def_delegator :@base_type, :real_type
|
|
@@ -6894,6 +6959,7 @@ module Cc1 #:nodoc:
|
|
|
6894
6959
|
|
|
6895
6960
|
def_delegator :@type, :image
|
|
6896
6961
|
def_delegator :@type, :brief_image
|
|
6962
|
+
def_delegator :@type, :named?
|
|
6897
6963
|
def_delegator :@type, :bit_size
|
|
6898
6964
|
def_delegator :@type, :bit_alignment
|
|
6899
6965
|
|
|
@@ -7019,6 +7085,10 @@ module Cc1 #:nodoc:
|
|
|
7019
7085
|
@id ||= TypeId.new(name)
|
|
7020
7086
|
end
|
|
7021
7087
|
|
|
7088
|
+
def named?
|
|
7089
|
+
true
|
|
7090
|
+
end
|
|
7091
|
+
|
|
7022
7092
|
def incomplete?
|
|
7023
7093
|
false
|
|
7024
7094
|
end
|