adlint 1.18.6 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/ChangeLog +287 -188
- data/MANIFEST +278 -92
- data/NEWS +16 -4
- data/bin/adlintize +124 -3
- data/etc/conf.d/fallback/traits.erb +54 -1
- data/etc/conf.d/i686-cygwin/traits-gcc_4.3.4.erb +54 -1
- data/etc/conf.d/i686-devkit/traits-gcc_4.5.2.erb +54 -1
- data/etc/conf.d/i686-linux/traits-gcc_4.5.1.erb +54 -1
- data/etc/conf.d/i686-mingw/traits-gcc_4.6.1.erb +54 -1
- data/etc/mesg.d/c_builtin/en_US/messages.yml +2998 -0
- data/etc/mesg.d/c_builtin/ja_JP/messages.yml +2998 -0
- data/etc/mesg.d/core/en_US/messages.yml +134 -0
- data/etc/mesg.d/core/ja_JP/messages.yml +134 -0
- data/features/{message_detection → code_check}/E0013.feature +2 -2
- data/features/{message_detection → code_check}/W0001.feature +4 -4
- data/features/{message_detection → code_check}/W0002.feature +6 -6
- data/features/{message_detection → code_check}/W0003.feature +8 -8
- data/features/{message_detection → code_check}/W0007.feature +16 -16
- data/features/{message_detection → code_check}/W0010.feature +8 -8
- data/features/{message_detection → code_check}/W0013.feature +16 -16
- data/features/code_check/W0016.feature +200 -0
- data/features/code_check/W0017.feature +270 -0
- data/features/code_check/W0025.feature +66 -0
- data/features/code_check/W0026.feature +143 -0
- data/features/{message_detection → code_check}/W0093.feature +6 -6
- data/features/{message_detection → code_check}/W0104.feature +14 -14
- data/features/{message_detection → code_check}/W0109.feature +6 -6
- data/features/code_check/W0119.feature +151 -0
- data/features/code_check/W0120.feature +137 -0
- data/features/code_check/W0121.feature +147 -0
- data/features/code_check/W0122.feature +142 -0
- data/features/code_check/W0123.feature +147 -0
- data/features/code_check/W0124.feature +142 -0
- data/features/code_check/W0125.feature +147 -0
- data/features/code_check/W0126.feature +142 -0
- data/features/code_check/W0127.feature +147 -0
- data/features/code_check/W0128.feature +147 -0
- data/features/code_check/W0129.feature +147 -0
- data/features/code_check/W0130.feature +159 -0
- data/features/code_check/W0131.feature +154 -0
- data/features/code_check/W0132.feature +137 -0
- data/features/code_check/W0133.feature +151 -0
- data/features/code_check/W0134.feature +151 -0
- data/features/code_check/W0135.feature +147 -0
- data/features/code_check/W0136.feature +151 -0
- data/features/code_check/W0137.feature +147 -0
- data/features/code_check/W0138.feature +151 -0
- data/features/code_check/W0139.feature +147 -0
- data/features/code_check/W0140.feature +159 -0
- data/features/code_check/W0141.feature +155 -0
- data/features/code_check/W0142.feature +152 -0
- data/features/code_check/W0143.feature +147 -0
- data/features/code_check/W0144.feature +146 -0
- data/features/code_check/W0145.feature +147 -0
- data/features/code_check/W0146.feature +146 -0
- data/features/code_check/W0147.feature +146 -0
- data/features/code_check/W0148.feature +147 -0
- data/features/code_check/W0149.feature +146 -0
- data/features/code_check/W0150.feature +146 -0
- data/features/code_check/W0151.feature +146 -0
- data/features/code_check/W0152.feature +155 -0
- data/features/code_check/W0153.feature +155 -0
- data/features/code_check/W0154.feature +154 -0
- data/features/code_check/W0155.feature +154 -0
- data/features/code_check/W0156.feature +167 -0
- data/features/code_check/W0157.feature +152 -0
- data/features/code_check/W0158.feature +147 -0
- data/features/code_check/W0159.feature +147 -0
- data/features/code_check/W0160.feature +147 -0
- data/features/code_check/W0161.feature +151 -0
- data/features/code_check/W0162.feature +146 -0
- data/features/code_check/W0163.feature +146 -0
- data/features/code_check/W0164.feature +146 -0
- data/features/code_check/W0165.feature +151 -0
- data/features/code_check/W0166.feature +146 -0
- data/features/code_check/W0167.feature +146 -0
- data/features/code_check/W0168.feature +146 -0
- data/features/code_check/W0169.feature +151 -0
- data/features/code_check/W0170.feature +146 -0
- data/features/code_check/W0171.feature +146 -0
- data/features/code_check/W0172.feature +146 -0
- data/features/code_check/W0173.feature +159 -0
- data/features/code_check/W0174.feature +159 -0
- data/features/code_check/W0175.feature +158 -0
- data/features/code_check/W0176.feature +158 -0
- data/features/code_check/W0177.feature +159 -0
- data/features/code_check/W0178.feature +155 -0
- data/features/code_check/W0179.feature +154 -0
- data/features/code_check/W0180.feature +154 -0
- data/features/code_check/W0181.feature +167 -0
- data/features/code_check/W0182.feature +147 -0
- data/features/code_check/W0183.feature +147 -0
- data/features/code_check/W0184.feature +148 -0
- data/features/code_check/W0185.feature +142 -0
- data/features/code_check/W0186.feature +142 -0
- data/features/code_check/W0187.feature +142 -0
- data/features/code_check/W0188.feature +142 -0
- data/features/code_check/W0189.feature +142 -0
- data/features/code_check/W0190.feature +142 -0
- data/features/code_check/W0191.feature +142 -0
- data/features/code_check/W0192.feature +142 -0
- data/features/code_check/W0193.feature +143 -0
- data/features/code_check/W0194.feature +142 -0
- data/features/code_check/W0195.feature +142 -0
- data/features/code_check/W0196.feature +142 -0
- data/features/code_check/W0197.feature +142 -0
- data/features/code_check/W0198.feature +142 -0
- data/features/code_check/W0199.feature +143 -0
- data/features/code_check/W0200.feature +142 -0
- data/features/code_check/W0201.feature +142 -0
- data/features/code_check/W0202.feature +142 -0
- data/features/code_check/W0203.feature +142 -0
- data/features/code_check/W0204.feature +142 -0
- data/features/code_check/W0205.feature +143 -0
- data/features/code_check/W0206.feature +150 -0
- data/features/code_check/W0207.feature +150 -0
- data/features/code_check/W0208.feature +150 -0
- data/features/code_check/W0209.feature +151 -0
- data/features/code_check/W0210.feature +151 -0
- data/features/code_check/W0211.feature +151 -0
- data/features/code_check/W0212.feature +147 -0
- data/features/code_check/W0213.feature +142 -0
- data/features/code_check/W0214.feature +147 -0
- data/features/code_check/W0215.feature +142 -0
- data/features/code_check/W0216.feature +142 -0
- data/features/code_check/W0217.feature +142 -0
- data/features/code_check/W0218.feature +142 -0
- data/features/code_check/W0219.feature +142 -0
- data/features/code_check/W0220.feature +142 -0
- data/features/code_check/W0221.feature +147 -0
- data/features/code_check/W0222.feature +142 -0
- data/features/code_check/W0223.feature +147 -0
- data/features/code_check/W0224.feature +142 -0
- data/features/code_check/W0225.feature +142 -0
- data/features/code_check/W0226.feature +142 -0
- data/features/code_check/W0227.feature +142 -0
- data/features/code_check/W0228.feature +142 -0
- data/features/code_check/W0229.feature +142 -0
- data/features/code_check/W0230.feature +147 -0
- data/features/code_check/W0231.feature +142 -0
- data/features/code_check/W0232.feature +148 -0
- data/features/code_check/W0233.feature +142 -0
- data/features/code_check/W0234.feature +143 -0
- data/features/code_check/W0235.feature +142 -0
- data/features/code_check/W0236.feature +143 -0
- data/features/code_check/W0237.feature +142 -0
- data/features/code_check/W0238.feature +143 -0
- data/features/code_check/W0239.feature +154 -0
- data/features/code_check/W0240.feature +155 -0
- data/features/code_check/W0241.feature +154 -0
- data/features/code_check/W0242.feature +155 -0
- data/features/code_check/W0243.feature +154 -0
- data/features/code_check/W0244.feature +155 -0
- data/features/code_check/W0245.feature +147 -0
- data/features/code_check/W0246.feature +147 -0
- data/features/code_check/W0247.feature +147 -0
- data/features/code_check/W0248.feature +142 -0
- data/features/code_check/W0249.feature +142 -0
- data/features/code_check/W0250.feature +146 -0
- data/features/code_check/W0251.feature +159 -0
- data/features/code_check/W0252.feature +155 -0
- data/features/code_check/W0253.feature +154 -0
- data/features/code_check/W0254.feature +154 -0
- data/features/code_check/W0477.feature +77 -0
- data/features/code_check/W0478.feature +103 -0
- data/features/code_check/W0479.feature +65 -0
- data/features/code_check/W0480.feature +119 -0
- data/features/code_check/W0481.feature +28 -0
- data/features/code_check/W0482.feature +64 -0
- data/features/code_check/W0483.feature +62 -0
- data/features/code_check/W0573.feature +91 -0
- data/features/{message_detection → code_check}/W0583.feature +2 -2
- data/features/{message_detection → code_check}/W0606.feature +2 -2
- data/features/{message_detection → code_check}/W0641.feature +16 -16
- data/features/{message_detection → code_check}/W0643.feature +12 -12
- data/features/{message_detection → code_check}/W0644.feature +50 -50
- data/features/{message_detection → code_check}/W0645.feature +16 -16
- data/features/{message_detection → code_check}/W0646.feature +16 -16
- data/features/{message_detection → code_check}/W0649.feature +28 -28
- data/features/{message_detection → code_check}/W0650.feature +24 -24
- data/features/code_check/W0685.feature +120 -0
- data/features/code_check/W0686.feature +92 -0
- data/features/{message_detection → code_check}/W0687.feature +4 -4
- data/features/{message_detection → code_check}/W0688.feature +12 -12
- data/features/{message_detection → code_check}/W0689.feature +8 -8
- data/features/{message_detection → code_check}/W0690.feature +6 -6
- data/features/{message_detection → code_check}/W0691.feature +14 -14
- data/features/{message_detection → code_check}/W0692.feature +4 -4
- data/features/{message_detection → code_check}/W0694.feature +10 -10
- data/features/code_check/W0695.feature +78 -0
- data/features/{message_detection → code_check}/W0697.feature +18 -18
- data/features/{message_detection → code_check}/W0698.feature +2 -2
- data/features/{message_detection → code_check}/W0699.feature +2 -2
- data/features/{message_detection → code_check}/W0700.feature +6 -6
- data/features/{message_detection → code_check}/W0703.feature +6 -6
- data/features/{message_detection → code_check}/W0705.feature +24 -24
- data/features/{message_detection → code_check}/W0707.feature +20 -20
- data/features/{message_detection → code_check}/W0711.feature +10 -10
- data/features/{message_detection → code_check}/W0712.feature +10 -10
- data/features/{message_detection → code_check}/W0713.feature +10 -10
- data/features/{message_detection → code_check}/W0714.feature +10 -10
- data/features/{message_detection → code_check}/W0715.feature +11 -11
- data/features/{message_detection → code_check}/W0716.feature +6 -6
- data/features/{message_detection → code_check}/W0717.feature +6 -6
- data/features/{message_detection → code_check}/W0718.feature +6 -6
- data/features/{message_detection → code_check}/W0719.feature +16 -16
- data/features/{message_detection → code_check}/W0723.feature +6 -6
- data/features/code_check/W0726.feature +95 -0
- data/features/{message_detection → code_check}/W0732.feature +6 -6
- data/features/{message_detection → code_check}/W0733.feature +6 -6
- data/features/{message_detection → code_check}/W0734.feature +16 -16
- data/features/{message_detection → code_check}/W0735.feature +16 -16
- data/features/{message_detection → code_check}/W0745.feature +10 -10
- data/features/code_check/W0747.feature +146 -0
- data/features/code_check/W0748.feature +148 -0
- data/features/code_check/W0749.feature +146 -0
- data/features/code_check/W0750.feature +146 -0
- data/features/code_check/W0751.feature +148 -0
- data/features/code_check/W0752.feature +143 -0
- data/features/code_check/W0753.feature +146 -0
- data/features/code_check/W0754.feature +146 -0
- data/features/code_check/W0755.feature +142 -0
- data/features/code_check/W0756.feature +148 -0
- data/features/code_check/W0757.feature +143 -0
- data/features/code_check/W0758.feature +143 -0
- data/features/code_check/W0759.feature +154 -0
- data/features/code_check/W0760.feature +154 -0
- data/features/code_check/W0761.feature +154 -0
- data/features/code_check/W0762.feature +154 -0
- data/features/code_check/W0763.feature +156 -0
- data/features/code_check/W0764.feature +151 -0
- data/features/code_check/W0765.feature +151 -0
- data/features/code_check/W0766.feature +151 -0
- data/features/code_check/W0767.feature +142 -0
- data/features/code_check/W0768.feature +142 -0
- data/features/code_check/W0769.feature +142 -0
- data/features/{message_detection → code_check}/W0780.feature +12 -12
- data/features/code_check/W0781.feature +145 -0
- data/features/{message_detection → code_check}/W0783.feature +8 -8
- data/features/{message_detection → code_check}/W0792.feature +16 -16
- data/features/{message_detection → code_check}/W0793.feature +16 -16
- data/features/{message_detection → code_check}/W0794.feature +10 -10
- data/features/code_check/W0801.feature +84 -0
- data/features/{message_detection → code_check}/W0805.feature +14 -14
- data/features/code_check/W0806.feature +24 -0
- data/features/code_check/W0807.feature +35 -0
- data/features/code_check/W0808.feature +34 -0
- data/features/code_check/W0809.feature +114 -0
- data/features/{message_detection → code_check}/W0811.feature +10 -10
- data/features/{message_detection → code_check}/W0830.feature +12 -12
- data/features/{message_detection → code_check}/W0833.feature +30 -30
- data/features/{message_detection → code_check}/W0834.feature +26 -26
- data/features/{message_detection → code_check}/W1026.feature +8 -8
- data/features/code_check/W1030.feature +84 -0
- data/features/{message_detection → code_check}/W1031.feature +36 -36
- data/features/{message_detection → code_check}/W1039.feature +24 -24
- data/features/{message_detection → code_check}/W1040.feature +8 -8
- data/features/{message_detection → code_check}/W1041.feature +2 -2
- data/features/{message_detection → code_check}/W1046.feature +6 -6
- data/features/{message_detection → code_check}/W1047.feature +12 -12
- data/features/{message_detection → code_check}/W1052.feature +6 -6
- data/features/{message_detection → code_check}/W1066.feature +6 -6
- data/features/{message_detection → code_check}/W1067.feature +6 -6
- data/features/{message_detection → code_check}/W1068.feature +6 -6
- data/features/{message_detection → code_check}/W1069.feature +10 -10
- data/features/{message_detection → code_check}/W1070.feature +15 -15
- data/features/{message_detection → code_check}/W1071.feature +8 -8
- data/features/{message_detection → code_check}/W1072.feature +2 -2
- data/features/{message_detection → code_check}/W1073.feature +14 -14
- data/features/{message_detection → code_check}/W1074.feature +10 -10
- data/features/{message_detection → code_check}/W1075.feature +10 -10
- data/features/{message_detection → code_check}/W1076.feature +8 -8
- data/features/{message_detection → code_check}/W1077.feature +18 -18
- data/features/{message_detection → code_check}/W9001.feature +2 -2
- data/features/{message_detection → code_check}/W9003.feature +12 -12
- data/features/step_definitions/{message_detection_steps.rb → code_check_steps.rb} +1 -1
- data/features/support/env.rb +19 -3
- data/lib/adlint.rb +1 -0
- data/lib/adlint/analyzer.rb +17 -1
- data/lib/adlint/c.rb +0 -4
- data/lib/adlint/c/phase.rb +55 -745
- data/lib/adlint/code.rb +0 -24
- data/lib/adlint/cpp.rb +0 -3
- data/lib/adlint/cpp/phase.rb +50 -112
- data/lib/adlint/driver.rb +2 -2
- data/lib/adlint/error.rb +4 -4
- data/lib/adlint/exam.rb +143 -0
- data/lib/adlint/exam/c_builtin.rb +813 -0
- data/lib/adlint/{c/message.rb → exam/c_builtin/c_check.rb} +2130 -798
- data/lib/adlint/{c/message_shima.rb → exam/c_builtin/c_check_shima.rb} +99 -28
- data/lib/adlint/{c/code.rb → exam/c_builtin/c_code.rb} +31 -5
- data/lib/adlint/{c/metric.rb → exam/c_builtin/c_metric.rb} +43 -11
- data/lib/adlint/{cpp/message.rb → exam/c_builtin/cpp_check.rb} +177 -73
- data/lib/adlint/{cpp/message_shima.rb → exam/c_builtin/cpp_check_shima.rb} +28 -8
- data/lib/adlint/{cpp/code.rb → exam/c_builtin/cpp_code.rb} +14 -3
- data/lib/adlint/{ld/message.rb → exam/c_builtin/ld_check.rb} +33 -12
- data/lib/adlint/{ld/metric.rb → exam/c_builtin/ld_metric.rb} +8 -3
- data/lib/adlint/lang.rb +2 -2
- data/lib/adlint/ld.rb +0 -2
- data/lib/adlint/ld/phase.rb +101 -101
- data/lib/adlint/message.rb +155 -98
- data/lib/adlint/metric.rb +0 -27
- data/lib/adlint/phase.rb +28 -3
- data/lib/adlint/report.rb +22 -12
- data/lib/adlint/traits.rb +97 -5
- data/lib/adlint/util.rb +100 -11
- data/lib/adlint/version.rb +5 -5
- data/share/doc/developers_guide_ja.html +3 -3
- data/share/doc/developers_guide_ja.texi +1 -1
- data/share/doc/users_guide_en.html +1817 -1648
- data/share/doc/users_guide_en.texi +202 -22
- data/share/doc/users_guide_ja.html +1836 -1663
- data/share/doc/users_guide_ja.texi +203 -20
- data/share/sample/bison-2.5/adlint/adlint_traits.yml +55 -2
- data/share/sample/bison-2.5/adlint/lib/adlint_traits.yml +47 -2
- data/share/sample/bison-2.5/adlint/src/adlint_traits.yml +47 -2
- data/share/sample/ctags-5.8/adlint/adlint_traits.yml +47 -2
- data/share/sample/flex-2.5.35/adlint/adlint_traits.yml +47 -2
- data/share/sample/ruby-1.9.3-p0/adlint/adlint_traits.yml +47 -2
- data/share/sample/ruby-1.9.3-p0/adlint/core/adlint_traits.yml +47 -2
- data/share/sample/ruby-1.9.3-p0/adlint/enc-trans/adlint_traits.yml +47 -2
- data/share/sample/ruby-1.9.3-p0/adlint/enc/adlint_traits.yml +47 -2
- data/share/sample/ruby-1.9.3-p0/adlint/ext-bigdecimal/adlint_traits.yml +47 -2
- data/share/sample/ruby-1.9.3-p0/adlint/ext-continuation/adlint_traits.yml +47 -2
- data/share/sample/ruby-1.9.3-p0/adlint/ext-coverage/adlint_traits.yml +47 -2
- data/share/sample/ruby-1.9.3-p0/adlint/ext-curses/adlint_traits.yml +47 -2
- data/share/sample/ruby-1.9.3-p0/adlint/ext-date/adlint_traits.yml +47 -2
- data/share/sample/ruby-1.9.3-p0/adlint/ext-dbm/adlint_traits.yml +47 -2
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-bubblebabble/adlint_traits.yml +47 -2
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-md5/adlint_traits.yml +47 -2
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-rmd160/adlint_traits.yml +47 -2
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-sha1/adlint_traits.yml +47 -2
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-sha2/adlint_traits.yml +47 -2
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest/adlint_traits.yml +47 -2
- data/share/sample/ruby-1.9.3-p0/adlint/ext-dl-callback/adlint_traits.yml +47 -2
- data/share/sample/ruby-1.9.3-p0/adlint/ext-dl/adlint_traits.yml +47 -2
- data/share/sample/ruby-1.9.3-p0/adlint/ext-etc/adlint_traits.yml +47 -2
- data/share/sample/ruby-1.9.3-p0/adlint/ext-fcntl/adlint_traits.yml +47 -2
- data/share/sample/ruby-1.9.3-p0/adlint/ext-fiber/adlint_traits.yml +47 -2
- data/share/sample/ruby-1.9.3-p0/adlint/ext-fiddle/adlint_traits.yml +47 -2
- data/share/sample/ruby-1.9.3-p0/adlint/ext-gdbm/adlint_traits.yml +47 -2
- data/share/sample/ruby-1.9.3-p0/adlint/ext-iconv/adlint_traits.yml +47 -2
- data/share/sample/ruby-1.9.3-p0/adlint/ext-io-console/adlint_traits.yml +47 -2
- data/share/sample/ruby-1.9.3-p0/adlint/ext-io-nonblock/adlint_traits.yml +47 -2
- data/share/sample/ruby-1.9.3-p0/adlint/ext-io-wait/adlint_traits.yml +47 -2
- data/share/sample/ruby-1.9.3-p0/adlint/ext-json-generator/adlint_traits.yml +47 -2
- data/share/sample/ruby-1.9.3-p0/adlint/ext-json-parser/adlint_traits.yml +47 -2
- data/share/sample/ruby-1.9.3-p0/adlint/ext-mathn-complex/adlint_traits.yml +47 -2
- data/share/sample/ruby-1.9.3-p0/adlint/ext-mathn-rational/adlint_traits.yml +47 -2
- data/share/sample/ruby-1.9.3-p0/adlint/ext-nkf/adlint_traits.yml +47 -2
- data/share/sample/ruby-1.9.3-p0/adlint/ext-openssl/adlint_traits.yml +47 -2
- data/share/sample/ruby-1.9.3-p0/adlint/ext-pathname/adlint_traits.yml +47 -2
- data/share/sample/ruby-1.9.3-p0/adlint/ext-psych/adlint_traits.yml +47 -2
- data/share/sample/ruby-1.9.3-p0/adlint/ext-pty/adlint_traits.yml +47 -2
- data/share/sample/ruby-1.9.3-p0/adlint/ext-racc-cparse/adlint_traits.yml +47 -2
- data/share/sample/ruby-1.9.3-p0/adlint/ext-readline/adlint_traits.yml +47 -2
- data/share/sample/ruby-1.9.3-p0/adlint/ext-ripper/adlint_traits.yml +47 -2
- data/share/sample/ruby-1.9.3-p0/adlint/ext-sdbm/adlint_traits.yml +47 -2
- data/share/sample/ruby-1.9.3-p0/adlint/ext-socket/adlint_traits.yml +47 -2
- data/share/sample/ruby-1.9.3-p0/adlint/ext-stringio/adlint_traits.yml +47 -2
- data/share/sample/ruby-1.9.3-p0/adlint/ext-strscan/adlint_traits.yml +47 -2
- data/share/sample/ruby-1.9.3-p0/adlint/ext-syck/adlint_traits.yml +47 -2
- data/share/sample/ruby-1.9.3-p0/adlint/ext-syslog/adlint_traits.yml +47 -2
- data/share/sample/ruby-1.9.3-p0/adlint/ext-zlib/adlint_traits.yml +47 -2
- data/share/sample/screen-4.0.3/adlint/adlint_traits.yml +47 -2
- data/share/sample/vim-7.3/adlint/vim/adlint_traits.yml +47 -2
- data/share/sample/vim-7.3/adlint/xxd/adlint_traits.yml +47 -2
- data/share/sample/zsh-4.3.15/adlint/adlint_traits.yml +47 -2
- data/share/sample/zsh-4.3.15/adlint/builtins/adlint_traits.yml +47 -2
- data/share/sample/zsh-4.3.15/adlint/core/adlint_traits.yml +47 -2
- data/share/sample/zsh-4.3.15/adlint/modules/adlint_traits.yml +47 -2
- data/share/sample/zsh-4.3.15/adlint/zle/adlint_traits.yml +47 -2
- data/spec/conf.d/default_traits.yml +56 -3
- metadata +280 -94
- data/etc/mesg.d/en_US/messages.yml +0 -797
- data/etc/mesg.d/ja_JP/messages.yml +0 -797
@@ -3,14 +3,14 @@ Feature: W0010
|
|
3
3
|
W0010 detects that a side-effect may occur in the conditional-expression.
|
4
4
|
|
5
5
|
Scenario: postfix-increment-expression and postfix-decrement-expression
|
6
|
-
Given a target source named "
|
6
|
+
Given a target source named "fixture.c" with:
|
7
7
|
"""
|
8
8
|
static int foo(int a, int b)
|
9
9
|
{
|
10
10
|
return (a > 0) ? b++ : b--; /* W0010 */
|
11
11
|
}
|
12
12
|
"""
|
13
|
-
When I successfully run `adlint
|
13
|
+
When I successfully run `adlint fixture.c` on noarch
|
14
14
|
Then the output should exactly match with:
|
15
15
|
| mesg | line | column |
|
16
16
|
| W1076 | 1 | 12 |
|
@@ -20,14 +20,14 @@ Feature: W0010
|
|
20
20
|
| W0628 | 1 | 12 |
|
21
21
|
|
22
22
|
Scenario: object-specifier and postfix-decrement-expression
|
23
|
-
Given a target source named "
|
23
|
+
Given a target source named "fixture.c" with:
|
24
24
|
"""
|
25
25
|
static int foo(int a, int b)
|
26
26
|
{
|
27
27
|
return (a > 0) ? b : b--; /* W0010 */
|
28
28
|
}
|
29
29
|
"""
|
30
|
-
When I successfully run `adlint
|
30
|
+
When I successfully run `adlint fixture.c` on noarch
|
31
31
|
Then the output should exactly match with:
|
32
32
|
| mesg | line | column |
|
33
33
|
| W1076 | 1 | 12 |
|
@@ -38,14 +38,14 @@ Feature: W0010
|
|
38
38
|
| W0628 | 1 | 12 |
|
39
39
|
|
40
40
|
Scenario: function-call-expression and constant-specifier
|
41
|
-
Given a target source named "
|
41
|
+
Given a target source named "fixture.c" with:
|
42
42
|
"""
|
43
43
|
static int foo(int a, int b)
|
44
44
|
{
|
45
45
|
return (a > 0) ? foo(1, b) : 0; /* W0010 */
|
46
46
|
}
|
47
47
|
"""
|
48
|
-
When I successfully run `adlint
|
48
|
+
When I successfully run `adlint fixture.c` on noarch
|
49
49
|
Then the output should exactly match with:
|
50
50
|
| mesg | line | column |
|
51
51
|
| W1076 | 1 | 12 |
|
@@ -57,14 +57,14 @@ Feature: W0010
|
|
57
57
|
| W0555 | 1 | 12 |
|
58
58
|
|
59
59
|
Scenario: additive-expression and multiplicative-expression
|
60
|
-
Given a target source named "
|
60
|
+
Given a target source named "fixture.c" with:
|
61
61
|
"""
|
62
62
|
static int foo(int a, int b)
|
63
63
|
{
|
64
64
|
return (a > 0) ? b / a : a + b; /* OK */
|
65
65
|
}
|
66
66
|
"""
|
67
|
-
When I successfully run `adlint
|
67
|
+
When I successfully run `adlint fixture.c` on noarch
|
68
68
|
Then the output should exactly match with:
|
69
69
|
| mesg | line | column |
|
70
70
|
| W1076 | 1 | 12 |
|
@@ -3,7 +3,7 @@ Feature: W0013
|
|
3
3
|
W0013 detects that a continue-statement is used in iteration-statement.
|
4
4
|
|
5
5
|
Scenario: a continue-statement in for-statement
|
6
|
-
Given a target source named "
|
6
|
+
Given a target source named "fixture.c" with:
|
7
7
|
"""
|
8
8
|
static void foo(void)
|
9
9
|
{
|
@@ -18,7 +18,7 @@ Feature: W0013
|
|
18
18
|
}
|
19
19
|
}
|
20
20
|
"""
|
21
|
-
When I successfully run `adlint
|
21
|
+
When I successfully run `adlint fixture.c` on noarch
|
22
22
|
Then the output should exactly match with:
|
23
23
|
| mesg | line | column |
|
24
24
|
| W1076 | 1 | 13 |
|
@@ -28,7 +28,7 @@ Feature: W0013
|
|
28
28
|
| W0628 | 1 | 13 |
|
29
29
|
|
30
30
|
Scenario: a continue-statement in c99-for-statement
|
31
|
-
Given a target source named "
|
31
|
+
Given a target source named "fixture.c" with:
|
32
32
|
"""
|
33
33
|
static void foo(void)
|
34
34
|
{
|
@@ -42,7 +42,7 @@ Feature: W0013
|
|
42
42
|
}
|
43
43
|
}
|
44
44
|
"""
|
45
|
-
When I successfully run `adlint
|
45
|
+
When I successfully run `adlint fixture.c` on noarch
|
46
46
|
Then the output should exactly match with:
|
47
47
|
| mesg | line | column |
|
48
48
|
| W1076 | 1 | 13 |
|
@@ -51,7 +51,7 @@ Feature: W0013
|
|
51
51
|
| W0628 | 1 | 13 |
|
52
52
|
|
53
53
|
Scenario: a continue-statement in while-statement
|
54
|
-
Given a target source named "
|
54
|
+
Given a target source named "fixture.c" with:
|
55
55
|
"""
|
56
56
|
static void foo(void)
|
57
57
|
{
|
@@ -67,7 +67,7 @@ Feature: W0013
|
|
67
67
|
}
|
68
68
|
}
|
69
69
|
"""
|
70
|
-
When I successfully run `adlint
|
70
|
+
When I successfully run `adlint fixture.c` on noarch
|
71
71
|
Then the output should exactly match with:
|
72
72
|
| mesg | line | column |
|
73
73
|
| W1076 | 1 | 13 |
|
@@ -76,7 +76,7 @@ Feature: W0013
|
|
76
76
|
| W0628 | 1 | 13 |
|
77
77
|
|
78
78
|
Scenario: a continue-statement in do-statement
|
79
|
-
Given a target source named "
|
79
|
+
Given a target source named "fixture.c" with:
|
80
80
|
"""
|
81
81
|
static void foo(void)
|
82
82
|
{
|
@@ -92,7 +92,7 @@ Feature: W0013
|
|
92
92
|
} while (i < 20);
|
93
93
|
}
|
94
94
|
"""
|
95
|
-
When I successfully run `adlint
|
95
|
+
When I successfully run `adlint fixture.c` on noarch
|
96
96
|
Then the output should exactly match with:
|
97
97
|
| mesg | line | column |
|
98
98
|
| W1076 | 1 | 13 |
|
@@ -101,7 +101,7 @@ Feature: W0013
|
|
101
101
|
| W0628 | 1 | 13 |
|
102
102
|
|
103
103
|
Scenario: no continue-statement in for-statement
|
104
|
-
Given a target source named "
|
104
|
+
Given a target source named "fixture.c" with:
|
105
105
|
"""
|
106
106
|
static void foo(void)
|
107
107
|
{
|
@@ -116,7 +116,7 @@ Feature: W0013
|
|
116
116
|
}
|
117
117
|
}
|
118
118
|
"""
|
119
|
-
When I successfully run `adlint
|
119
|
+
When I successfully run `adlint fixture.c` on noarch
|
120
120
|
Then the output should exactly match with:
|
121
121
|
| mesg | line | column |
|
122
122
|
| W1076 | 1 | 13 |
|
@@ -125,7 +125,7 @@ Feature: W0013
|
|
125
125
|
| W0628 | 1 | 13 |
|
126
126
|
|
127
127
|
Scenario: no continue-statement in c99-for-statement
|
128
|
-
Given a target source named "
|
128
|
+
Given a target source named "fixture.c" with:
|
129
129
|
"""
|
130
130
|
static void foo(void)
|
131
131
|
{
|
@@ -139,7 +139,7 @@ Feature: W0013
|
|
139
139
|
}
|
140
140
|
}
|
141
141
|
"""
|
142
|
-
When I successfully run `adlint
|
142
|
+
When I successfully run `adlint fixture.c` on noarch
|
143
143
|
Then the output should exactly match with:
|
144
144
|
| mesg | line | column |
|
145
145
|
| W1076 | 1 | 13 |
|
@@ -147,7 +147,7 @@ Feature: W0013
|
|
147
147
|
| W0628 | 1 | 13 |
|
148
148
|
|
149
149
|
Scenario: no continue-statement in while-statement
|
150
|
-
Given a target source named "
|
150
|
+
Given a target source named "fixture.c" with:
|
151
151
|
"""
|
152
152
|
static void foo(void)
|
153
153
|
{
|
@@ -163,7 +163,7 @@ Feature: W0013
|
|
163
163
|
}
|
164
164
|
}
|
165
165
|
"""
|
166
|
-
When I successfully run `adlint
|
166
|
+
When I successfully run `adlint fixture.c` on noarch
|
167
167
|
Then the output should exactly match with:
|
168
168
|
| mesg | line | column |
|
169
169
|
| W1076 | 1 | 13 |
|
@@ -171,7 +171,7 @@ Feature: W0013
|
|
171
171
|
| W0628 | 1 | 13 |
|
172
172
|
|
173
173
|
Scenario: no continue-statement in do-statement
|
174
|
-
Given a target source named "
|
174
|
+
Given a target source named "fixture.c" with:
|
175
175
|
"""
|
176
176
|
static void foo(void)
|
177
177
|
{
|
@@ -187,7 +187,7 @@ Feature: W0013
|
|
187
187
|
} while (i < 20);
|
188
188
|
}
|
189
189
|
"""
|
190
|
-
When I successfully run `adlint
|
190
|
+
When I successfully run `adlint fixture.c` on noarch
|
191
191
|
Then the output should exactly match with:
|
192
192
|
| mesg | line | column |
|
193
193
|
| W1076 | 1 | 13 |
|
@@ -0,0 +1,200 @@
|
|
1
|
+
Feature: W0016
|
2
|
+
|
3
|
+
W0016 detects that field-width of the conversion-specifier in `*printf'
|
4
|
+
function call is greater than 509.
|
5
|
+
|
6
|
+
Scenario: field-width of `%d' conversion-specifier in `printf' function call
|
7
|
+
is greater than 509
|
8
|
+
Given a target source named "fixture.c" with:
|
9
|
+
"""
|
10
|
+
#include <stdio.h>
|
11
|
+
|
12
|
+
int foo(int i)
|
13
|
+
{
|
14
|
+
return printf("%512d", i); /* W0016 */
|
15
|
+
}
|
16
|
+
"""
|
17
|
+
When I successfully run `adlint fixture.c` on noarch
|
18
|
+
Then the output should exactly match with:
|
19
|
+
| mesg | line | column |
|
20
|
+
| W0117 | 3 | 5 |
|
21
|
+
| W0016 | 5 | 19 |
|
22
|
+
| W0104 | 3 | 13 |
|
23
|
+
| W0947 | 5 | 19 |
|
24
|
+
| W0628 | 3 | 5 |
|
25
|
+
|
26
|
+
Scenario: field-width of `%d' conversion-specifier in `printf' function call
|
27
|
+
is equal to 510
|
28
|
+
Given a target source named "fixture.c" with:
|
29
|
+
"""
|
30
|
+
#include <stdio.h>
|
31
|
+
|
32
|
+
int foo(int i)
|
33
|
+
{
|
34
|
+
return printf("%510d", i); /* W0016 */
|
35
|
+
}
|
36
|
+
"""
|
37
|
+
When I successfully run `adlint fixture.c` on noarch
|
38
|
+
Then the output should exactly match with:
|
39
|
+
| mesg | line | column |
|
40
|
+
| W0117 | 3 | 5 |
|
41
|
+
| W0016 | 5 | 19 |
|
42
|
+
| W0104 | 3 | 13 |
|
43
|
+
| W0947 | 5 | 19 |
|
44
|
+
| W0628 | 3 | 5 |
|
45
|
+
|
46
|
+
Scenario: field-width of `%d' conversion-specifier in `printf' function call
|
47
|
+
is equal to 509
|
48
|
+
Given a target source named "fixture.c" with:
|
49
|
+
"""
|
50
|
+
#include <stdio.h>
|
51
|
+
|
52
|
+
int foo(int i)
|
53
|
+
{
|
54
|
+
return printf("%509d", i); /* OK */
|
55
|
+
}
|
56
|
+
"""
|
57
|
+
When I successfully run `adlint fixture.c` on noarch
|
58
|
+
Then the output should exactly match with:
|
59
|
+
| mesg | line | column |
|
60
|
+
| W0117 | 3 | 5 |
|
61
|
+
| W0104 | 3 | 13 |
|
62
|
+
| W0947 | 5 | 19 |
|
63
|
+
| W0628 | 3 | 5 |
|
64
|
+
|
65
|
+
Scenario: field-width of `%d' conversion-specifier in `printf' function call
|
66
|
+
is less than 509
|
67
|
+
Given a target source named "fixture.c" with:
|
68
|
+
"""
|
69
|
+
#include <stdio.h>
|
70
|
+
|
71
|
+
int foo(int i)
|
72
|
+
{
|
73
|
+
return printf("%500d", i); /* OK */
|
74
|
+
}
|
75
|
+
"""
|
76
|
+
When I successfully run `adlint fixture.c` on noarch
|
77
|
+
Then the output should exactly match with:
|
78
|
+
| mesg | line | column |
|
79
|
+
| W0117 | 3 | 5 |
|
80
|
+
| W0104 | 3 | 13 |
|
81
|
+
| W0947 | 5 | 19 |
|
82
|
+
| W0628 | 3 | 5 |
|
83
|
+
|
84
|
+
Scenario: no field-width of `%d' conversion-specifier in `printf' function
|
85
|
+
call
|
86
|
+
Given a target source named "fixture.c" with:
|
87
|
+
"""
|
88
|
+
#include <stdio.h>
|
89
|
+
|
90
|
+
int foo(int i)
|
91
|
+
{
|
92
|
+
return printf("%d", i); /* OK */
|
93
|
+
}
|
94
|
+
"""
|
95
|
+
When I successfully run `adlint fixture.c` on noarch
|
96
|
+
Then the output should exactly match with:
|
97
|
+
| mesg | line | column |
|
98
|
+
| W0117 | 3 | 5 |
|
99
|
+
| W0104 | 3 | 13 |
|
100
|
+
| W0947 | 5 | 19 |
|
101
|
+
| W0628 | 3 | 5 |
|
102
|
+
|
103
|
+
Scenario: field-width of `%d' conversion-specifier in `fprintf' function call
|
104
|
+
is greater than 509
|
105
|
+
Given a target source named "fixture.c" with:
|
106
|
+
"""
|
107
|
+
#include <stdio.h>
|
108
|
+
|
109
|
+
int foo(int i)
|
110
|
+
{
|
111
|
+
return fprintf(stdout, "%512d", i); /* W0016 */
|
112
|
+
}
|
113
|
+
"""
|
114
|
+
When I successfully run `adlint fixture.c` on noarch
|
115
|
+
Then the output should exactly match with:
|
116
|
+
| mesg | line | column |
|
117
|
+
| W0117 | 3 | 5 |
|
118
|
+
| W0016 | 5 | 28 |
|
119
|
+
| W0104 | 3 | 13 |
|
120
|
+
| W0947 | 5 | 28 |
|
121
|
+
| W0628 | 3 | 5 |
|
122
|
+
|
123
|
+
Scenario: field-width of `%d' conversion-specifier in `fprintf' function call
|
124
|
+
is equal to 510
|
125
|
+
Given a target source named "fixture.c" with:
|
126
|
+
"""
|
127
|
+
#include <stdio.h>
|
128
|
+
|
129
|
+
int foo(int i)
|
130
|
+
{
|
131
|
+
return fprintf(stdout, "%510d", i); /* W0016 */
|
132
|
+
}
|
133
|
+
"""
|
134
|
+
When I successfully run `adlint fixture.c` on noarch
|
135
|
+
Then the output should exactly match with:
|
136
|
+
| mesg | line | column |
|
137
|
+
| W0117 | 3 | 5 |
|
138
|
+
| W0016 | 5 | 28 |
|
139
|
+
| W0104 | 3 | 13 |
|
140
|
+
| W0947 | 5 | 28 |
|
141
|
+
| W0628 | 3 | 5 |
|
142
|
+
|
143
|
+
Scenario: field-width of `%d' conversion-specifier in `fprintf' function call
|
144
|
+
is equal to 509
|
145
|
+
Given a target source named "fixture.c" with:
|
146
|
+
"""
|
147
|
+
#include <stdio.h>
|
148
|
+
|
149
|
+
int foo(int i)
|
150
|
+
{
|
151
|
+
return fprintf(stdout, "%509d", i); /* OK */
|
152
|
+
}
|
153
|
+
"""
|
154
|
+
When I successfully run `adlint fixture.c` on noarch
|
155
|
+
Then the output should exactly match with:
|
156
|
+
| mesg | line | column |
|
157
|
+
| W0117 | 3 | 5 |
|
158
|
+
| W0104 | 3 | 13 |
|
159
|
+
| W0947 | 5 | 28 |
|
160
|
+
| W0628 | 3 | 5 |
|
161
|
+
|
162
|
+
Scenario: field-width of `%d' conversion-specifier in `fprintf' function call
|
163
|
+
is less than 509
|
164
|
+
Given a target source named "fixture.c" with:
|
165
|
+
"""
|
166
|
+
#include <stdio.h>
|
167
|
+
|
168
|
+
int foo(int i)
|
169
|
+
{
|
170
|
+
return fprintf(stdout, "%500d", i); /* OK */
|
171
|
+
}
|
172
|
+
"""
|
173
|
+
When I successfully run `adlint fixture.c` on noarch
|
174
|
+
Then the output should exactly match with:
|
175
|
+
| mesg | line | column |
|
176
|
+
| W0117 | 3 | 5 |
|
177
|
+
| W0104 | 3 | 13 |
|
178
|
+
| W0947 | 5 | 28 |
|
179
|
+
| W0628 | 3 | 5 |
|
180
|
+
|
181
|
+
Scenario: no field-width of `%d' conversion-specifier in `fprintf' function
|
182
|
+
call
|
183
|
+
Given a target source named "fixture.c" with:
|
184
|
+
"""
|
185
|
+
#include <stdio.h>
|
186
|
+
|
187
|
+
int foo(int i)
|
188
|
+
{
|
189
|
+
return fprintf(stdout, "%d", i); /* OK */
|
190
|
+
}
|
191
|
+
"""
|
192
|
+
When I successfully run `adlint fixture.c` on noarch
|
193
|
+
Then the output should exactly match with:
|
194
|
+
| mesg | line | column |
|
195
|
+
| W0117 | 3 | 5 |
|
196
|
+
| W0104 | 3 | 13 |
|
197
|
+
| W0947 | 5 | 28 |
|
198
|
+
| W0628 | 3 | 5 |
|
199
|
+
|
200
|
+
# vim:ts=2:sw=2:sts=2:et:
|
@@ -0,0 +1,270 @@
|
|
1
|
+
Feature: W0017
|
2
|
+
|
3
|
+
W0017 detects that field-width of the conversion-specifier in `*scanf'
|
4
|
+
function call is greater than 509.
|
5
|
+
|
6
|
+
Scenario: field-width of `%d' conversion-specifier in `scanf' function call
|
7
|
+
is greater than 509
|
8
|
+
Given a target source named "fixture.c" with:
|
9
|
+
"""
|
10
|
+
#include <stdio.h>
|
11
|
+
|
12
|
+
int foo(int *p)
|
13
|
+
{
|
14
|
+
if (p != NULL) {
|
15
|
+
*p = 0;
|
16
|
+
return scanf("%512d", p); /* W0017 */
|
17
|
+
}
|
18
|
+
else {
|
19
|
+
return -1;
|
20
|
+
}
|
21
|
+
}
|
22
|
+
"""
|
23
|
+
When I successfully run `adlint fixture.c` on noarch
|
24
|
+
Then the output should exactly match with:
|
25
|
+
| mesg | line | column |
|
26
|
+
| W0117 | 3 | 5 |
|
27
|
+
| W0017 | 7 | 22 |
|
28
|
+
| W0104 | 3 | 14 |
|
29
|
+
| W1071 | 3 | 5 |
|
30
|
+
| W0947 | 7 | 22 |
|
31
|
+
| W0628 | 3 | 5 |
|
32
|
+
|
33
|
+
Scenario: field-width of `%d' conversion-specifier in `scanf' function call
|
34
|
+
is equal to 510
|
35
|
+
Given a target source named "fixture.c" with:
|
36
|
+
"""
|
37
|
+
#include <stdio.h>
|
38
|
+
|
39
|
+
int foo(int *p)
|
40
|
+
{
|
41
|
+
if (p != NULL) {
|
42
|
+
*p = 0;
|
43
|
+
return scanf("%510d", p); /* W0017 */
|
44
|
+
}
|
45
|
+
else {
|
46
|
+
return -1;
|
47
|
+
}
|
48
|
+
}
|
49
|
+
"""
|
50
|
+
When I successfully run `adlint fixture.c` on noarch
|
51
|
+
Then the output should exactly match with:
|
52
|
+
| mesg | line | column |
|
53
|
+
| W0117 | 3 | 5 |
|
54
|
+
| W0017 | 7 | 22 |
|
55
|
+
| W0104 | 3 | 14 |
|
56
|
+
| W1071 | 3 | 5 |
|
57
|
+
| W0947 | 7 | 22 |
|
58
|
+
| W0628 | 3 | 5 |
|
59
|
+
|
60
|
+
Scenario: field-width of `%d' conversion-specifier in `scanf' function call
|
61
|
+
is equal to 509
|
62
|
+
Given a target source named "fixture.c" with:
|
63
|
+
"""
|
64
|
+
#include <stdio.h>
|
65
|
+
|
66
|
+
int foo(int *p)
|
67
|
+
{
|
68
|
+
if (p != NULL) {
|
69
|
+
*p = 0;
|
70
|
+
return scanf("%509d", p); /* OK */
|
71
|
+
}
|
72
|
+
else {
|
73
|
+
return -1;
|
74
|
+
}
|
75
|
+
}
|
76
|
+
"""
|
77
|
+
When I successfully run `adlint fixture.c` on noarch
|
78
|
+
Then the output should exactly match with:
|
79
|
+
| mesg | line | column |
|
80
|
+
| W0117 | 3 | 5 |
|
81
|
+
| W0104 | 3 | 14 |
|
82
|
+
| W1071 | 3 | 5 |
|
83
|
+
| W0947 | 7 | 22 |
|
84
|
+
| W0628 | 3 | 5 |
|
85
|
+
|
86
|
+
Scenario: field-width of `%d' conversion-specifier in `scanf' function call
|
87
|
+
is less than 509
|
88
|
+
Given a target source named "fixture.c" with:
|
89
|
+
"""
|
90
|
+
#include <stdio.h>
|
91
|
+
|
92
|
+
int foo(int *p)
|
93
|
+
{
|
94
|
+
if (p != NULL) {
|
95
|
+
*p = 0;
|
96
|
+
return scanf("%500d", p); /* OK */
|
97
|
+
}
|
98
|
+
else {
|
99
|
+
return -1;
|
100
|
+
}
|
101
|
+
}
|
102
|
+
"""
|
103
|
+
When I successfully run `adlint fixture.c` on noarch
|
104
|
+
Then the output should exactly match with:
|
105
|
+
| mesg | line | column |
|
106
|
+
| W0117 | 3 | 5 |
|
107
|
+
| W0104 | 3 | 14 |
|
108
|
+
| W1071 | 3 | 5 |
|
109
|
+
| W0947 | 7 | 22 |
|
110
|
+
| W0628 | 3 | 5 |
|
111
|
+
|
112
|
+
Scenario: no field-width of `%d' conversion-specifier in `scanf' function
|
113
|
+
call
|
114
|
+
Given a target source named "fixture.c" with:
|
115
|
+
"""
|
116
|
+
#include <stdio.h>
|
117
|
+
|
118
|
+
int foo(int *p)
|
119
|
+
{
|
120
|
+
if (p != NULL) {
|
121
|
+
*p = 0;
|
122
|
+
return scanf("%d", p); /* OK */
|
123
|
+
}
|
124
|
+
else {
|
125
|
+
return -1;
|
126
|
+
}
|
127
|
+
}
|
128
|
+
"""
|
129
|
+
When I successfully run `adlint fixture.c` on noarch
|
130
|
+
Then the output should exactly match with:
|
131
|
+
| mesg | line | column |
|
132
|
+
| W0117 | 3 | 5 |
|
133
|
+
| W0104 | 3 | 14 |
|
134
|
+
| W1071 | 3 | 5 |
|
135
|
+
| W0947 | 7 | 22 |
|
136
|
+
| W0628 | 3 | 5 |
|
137
|
+
|
138
|
+
Scenario: field-width of `%d' conversion-specifier in `fscanf' function call
|
139
|
+
is greater than 509
|
140
|
+
Given a target source named "fixture.c" with:
|
141
|
+
"""
|
142
|
+
#include <stdio.h>
|
143
|
+
|
144
|
+
int foo(int *p)
|
145
|
+
{
|
146
|
+
if (p != NULL) {
|
147
|
+
*p = 0;
|
148
|
+
return fscanf(stdin, "%512d", p); /* W0017 */
|
149
|
+
}
|
150
|
+
else {
|
151
|
+
return -1;
|
152
|
+
}
|
153
|
+
}
|
154
|
+
"""
|
155
|
+
When I successfully run `adlint fixture.c` on noarch
|
156
|
+
Then the output should exactly match with:
|
157
|
+
| mesg | line | column |
|
158
|
+
| W0117 | 3 | 5 |
|
159
|
+
| W0017 | 7 | 30 |
|
160
|
+
| W0104 | 3 | 14 |
|
161
|
+
| W1071 | 3 | 5 |
|
162
|
+
| W0947 | 7 | 30 |
|
163
|
+
| W0628 | 3 | 5 |
|
164
|
+
|
165
|
+
Scenario: field-width of `%d' conversion-specifier in `fscanf' function call
|
166
|
+
is equal to 510
|
167
|
+
Given a target source named "fixture.c" with:
|
168
|
+
"""
|
169
|
+
#include <stdio.h>
|
170
|
+
|
171
|
+
int foo(int *p)
|
172
|
+
{
|
173
|
+
if (p != NULL) {
|
174
|
+
*p = 0;
|
175
|
+
return fscanf(stdin, "%510d", p); /* W0017 */
|
176
|
+
}
|
177
|
+
else {
|
178
|
+
return -1;
|
179
|
+
}
|
180
|
+
}
|
181
|
+
"""
|
182
|
+
When I successfully run `adlint fixture.c` on noarch
|
183
|
+
Then the output should exactly match with:
|
184
|
+
| mesg | line | column |
|
185
|
+
| W0117 | 3 | 5 |
|
186
|
+
| W0017 | 7 | 30 |
|
187
|
+
| W0104 | 3 | 14 |
|
188
|
+
| W1071 | 3 | 5 |
|
189
|
+
| W0947 | 7 | 30 |
|
190
|
+
| W0628 | 3 | 5 |
|
191
|
+
|
192
|
+
Scenario: field-width of `%d' conversion-specifier in `fscanf' function call
|
193
|
+
is equal to 509
|
194
|
+
Given a target source named "fixture.c" with:
|
195
|
+
"""
|
196
|
+
#include <stdio.h>
|
197
|
+
|
198
|
+
int foo(int *p)
|
199
|
+
{
|
200
|
+
if (p != NULL) {
|
201
|
+
*p = 0;
|
202
|
+
return fscanf(stdin, "%509d", p); /* OK */
|
203
|
+
}
|
204
|
+
else {
|
205
|
+
return -1;
|
206
|
+
}
|
207
|
+
}
|
208
|
+
"""
|
209
|
+
When I successfully run `adlint fixture.c` on noarch
|
210
|
+
Then the output should exactly match with:
|
211
|
+
| mesg | line | column |
|
212
|
+
| W0117 | 3 | 5 |
|
213
|
+
| W0104 | 3 | 14 |
|
214
|
+
| W1071 | 3 | 5 |
|
215
|
+
| W0947 | 7 | 30 |
|
216
|
+
| W0628 | 3 | 5 |
|
217
|
+
|
218
|
+
Scenario: field-width of `%d' conversion-specifier in `fscanf' function call
|
219
|
+
is less than 509
|
220
|
+
Given a target source named "fixture.c" with:
|
221
|
+
"""
|
222
|
+
#include <stdio.h>
|
223
|
+
|
224
|
+
int foo(int *p)
|
225
|
+
{
|
226
|
+
if (p != NULL) {
|
227
|
+
*p = 0;
|
228
|
+
return fscanf(stdin, "%500d", p); /* OK */
|
229
|
+
}
|
230
|
+
else {
|
231
|
+
return -1;
|
232
|
+
}
|
233
|
+
}
|
234
|
+
"""
|
235
|
+
When I successfully run `adlint fixture.c` on noarch
|
236
|
+
Then the output should exactly match with:
|
237
|
+
| mesg | line | column |
|
238
|
+
| W0117 | 3 | 5 |
|
239
|
+
| W0104 | 3 | 14 |
|
240
|
+
| W1071 | 3 | 5 |
|
241
|
+
| W0947 | 7 | 30 |
|
242
|
+
| W0628 | 3 | 5 |
|
243
|
+
|
244
|
+
Scenario: no field-width of `%d' conversion-specifier in `fscanf' function
|
245
|
+
call
|
246
|
+
Given a target source named "fixture.c" with:
|
247
|
+
"""
|
248
|
+
#include <stdio.h>
|
249
|
+
|
250
|
+
int foo(int *p)
|
251
|
+
{
|
252
|
+
if (p != NULL) {
|
253
|
+
*p = 0;
|
254
|
+
return fscanf(stdin, "%d", p); /* OK */
|
255
|
+
}
|
256
|
+
else {
|
257
|
+
return -1;
|
258
|
+
}
|
259
|
+
}
|
260
|
+
"""
|
261
|
+
When I successfully run `adlint fixture.c` on noarch
|
262
|
+
Then the output should exactly match with:
|
263
|
+
| mesg | line | column |
|
264
|
+
| W0117 | 3 | 5 |
|
265
|
+
| W0104 | 3 | 14 |
|
266
|
+
| W1071 | 3 | 5 |
|
267
|
+
| W0947 | 7 | 30 |
|
268
|
+
| W0628 | 3 | 5 |
|
269
|
+
|
270
|
+
# vim:ts=2:sw=2:sts=2:et:
|