Not sure if interesting to anyone, but I just ran svn head againt cppcheck...
this is the result: [./contrib/libdcc/dcc_stdio.c:156]: (style) Warning - using char variable in bit operation [./src/flash/aduc702x.c:140]: (style) The scope of the variable x can be limited [./src/flash/aduc702x.c:141]: (style) The scope of the variable count can be limited [./src/flash/at91sam3.c:2263]: (style) Redundant condition. It is safe to deallocate a NULL pointer [./src/flash/at91sam3.c:599]: (style) The scope of the variable n can be limited [./src/flash/at91sam3.c:2117]: (style) The scope of the variable n can be limited [./src/flash/at91sam3.c:2349]: (style) The scope of the variable x can be limited [./src/flash/at91sam3.c:2448]: (style) The scope of the variable r can be limited [./src/flash/at91sam3.c:122]: (style) struct or union member 'sam3_cfg::pclk0_freq' is never used [./src/flash/at91sam3.c:123]: (style) struct or union member 'sam3_cfg::pclk1_freq' is never used [./src/flash/at91sam3.c:124]: (style) struct or union member 'sam3_cfg::pclk2_freq' is never used [./src/flash/at91sam3.c:130]: (style) struct or union member 'sam3_cfg::CHIPID_EXID' is never used [./src/flash/at91sam3.c:133]: (style) struct or union member 'sam3_cfg::SUPC_CR' is never used [./src/flash/at91sam3.c:137]: (style) struct or union member 'sam3_cfg::PMC_SCSR' is never used [./src/flash/at91sam3.c:139]: (style) struct or union member 'sam3_cfg::PMC_PCSR' is never used [./src/flash/at91sam3.c:151]: (style) struct or union member 'sam3_cfg::PMC_PCK0' is never used [./src/flash/at91sam3.c:153]: (style) struct or union member 'sam3_cfg::PMC_PCK1' is never used [./src/flash/at91sam3.c:155]: (style) struct or union member 'sam3_cfg::PMC_PCK2' is never used [./src/flash/at91sam3.c:157]: (style) struct or union member 'sam3_cfg::PMC_SR' is never used [./src/flash/at91sam3.c:159]: (style) struct or union member 'sam3_cfg::PMC_IMR' is never used [./src/flash/at91sam3.c:161]: (style) struct or union member 'sam3_cfg::PMC_FSMR' is never used [./src/flash/at91sam3.c:163]: (style) struct or union member 'sam3_cfg::PMC_FSPR' is never used [./src/flash/at91sam7.c:138]: (style) The scope of the variable mainfreq can be limited [./src/flash/at91sam7.c:214]: (style) The scope of the variable fmr can be limited [./src/flash/at91sam7.c:863]: (style) The scope of the variable nbytes can be limited [./src/flash/at91sam7.c:863]: (style) The scope of the variable pos can be limited [./src/flash/at91sam7.c:1137]: (style) The scope of the variable retval can be limited [./src/flash/at91sam7.c:912]: (error) Memory leak: buffer [./src/flash/avrf.c:460]: (style) The scope of the variable i can be limited [./src/flash/cfi.c:344]: (style) The scope of the variable retval can be limited [./src/flash/cfi.c:410]: (style) The scope of the variable retval can be limited [./src/flash/cfi.c:475]: (style) The scope of the variable retval can be limited [./src/flash/cfi.c:2115]: (style) The scope of the variable i can be limited [./src/flash/ecos.c:63]: (style) struct or union member 'ecosflash_flash_bank_s::write_algorithm' is never used [./src/flash/ecos.c:64]: (style) struct or union member 'ecosflash_flash_bank_s::erase_check_algorithm' is never used [./src/flash/flash.c:399]: (style) The scope of the variable retval can be limited [./src/flash/flash.c:435]: (style) The scope of the variable retval can be limited [./src/flash/flash.c:531]: (style) The scope of the variable retval can be limited [./src/flash/lpc2000.c:276]: (style) The scope of the variable retval can be limited [./src/flash/lpc2900.c:1288]: (style) The scope of the variable num_bytes can be limited [./src/flash/lpc3180_nand_controller.c:137]: (style) The scope of the variable hclk_pll can be limited [./src/flash/lpc3180_nand_controller.c:509]: (style) The scope of the variable retval can be limited [./src/flash/lpc3180_nand_controller.c:630]: (error) Memory leak: page_buffer [./src/flash/lpc3180_nand_controller.c:630]: (error) Memory leak: oob_buffer [./src/flash/lpc3180_nand_controller.c:754]: (error) Memory leak: page_buffer [./src/flash/lpc3180_nand_controller.c:754]: (error) Memory leak: oob_buffer [./src/flash/mflash.c:135]: (style) The scope of the variable mask can be limited [./src/flash/mflash.c:167]: (style) The scope of the variable mask can be limited [./src/flash/mflash.c:1220]: (style) The scope of the variable fin can be limited [./src/flash/mflash.c:1220]: (style) The scope of the variable fout can be limited [./src/flash/nand.c:1172]: (style) The scope of the variable retval can be limited [./src/flash/nand.c:1206]: (style) The scope of the variable retval can be limited [./src/flash/nand.c:1337]: (style) The scope of the variable offset can be limited [./src/flash/nand.c:1338]: (style) The scope of the variable binary_size can be limited [./src/flash/nand.c:1339]: (style) The scope of the variable buf_cnt can be limited [./src/flash/nand.c:1572]: (all) Memory leak: page [./src/flash/nand.c:1572]: (all) Memory leak: oob [./src/flash/pic32mx.c:521]: (style) The scope of the variable retval can be limited [./src/flash/stellaris.c:953]: (style) The scope of the variable retval can be limited [./src/flash/stellaris.c:1166]: (style) The scope of the variable i can be limited [./src/flash/stm32x.c:608]: (style) The scope of the variable retval can be limited [./src/flash/stm32x.c:1214]: (style) The scope of the variable i can be limited [./src/flash/str7x.c:298]: (style) The scope of the variable i can be limited [./src/flash/str9xpec.c:564]: (style) The scope of the variable i can be limited [./src/helper/ioutil.c:301]: (style) Redundant condition. It is safe to deallocate a NULL pointer [./src/helper/jim-eventloop.c:290]: (style) The scope of the variable dt can be limited [./src/helper/jim.c:2252]: (style) The scope of the variable c can be limited [./src/helper/jim.c:2267]: (style) The scope of the variable accum can be limited [./src/helper/jim.c:3230]: (style) The scope of the variable i can be limited [./src/helper/jim.c:6894]: (style) The scope of the variable wC can be limited [./src/helper/jim.c:6895]: (style) The scope of the variable dC can be limited [./src/helper/jim.c:6897]: (style) The scope of the variable retcode can be limited [./src/helper/jim.c:7529]: (style) The scope of the variable i can be limited [./src/helper/jim.c:7599]: (style) The scope of the variable i can be limited [./src/helper/jim.c:9017]: (style) The scope of the variable retval can be limited [./src/helper/jim.c:10295]: (style) The scope of the variable retval can be limited [./src/helper/jim.c:11892]: (style) The scope of the variable i can be limited [./src/helper/jim.c:11822]: (all) Buffer overrun [./src/helper/log.c:415]: (style) Redundant condition. It is safe to deallocate a NULL pointer [./src/helper/membuf.c:212]: (style) The scope of the variable r can be limited [./src/helper/replacements.c:87]: (style) The scope of the variable li can be limited [./src/helper/replacements.c:88]: (style) The scope of the variable t can be limited [./src/jtag/amt_jtagaccel.c:372]: (style) Redundant condition. It is safe to deallocate a NULL pointer [./src/jtag/amt_jtagaccel.c:243]: (style) The scope of the variable aw_tdi_option can be limited [./src/jtag/arm-jtag-ew.c:635]: (style) The scope of the variable byte_length can be limited [./src/jtag/arm-jtag-ew.c:636]: (style) The scope of the variable tms_offset can be limited [./src/jtag/arm-jtag-ew.c:637]: (style) The scope of the variable tdi_offset can be limited [./src/jtag/arm-jtag-ew.c:638]: (style) The scope of the variable i can be limited [./src/jtag/arm-jtag-ew.c:639]: (style) The scope of the variable result can be limited [./src/jtag/bitbang.c:306]: (style) Redundant condition. It is safe to deallocate a NULL pointer [./src/jtag/commands.c:90]: (style) The scope of the variable i can be limited [./src/jtag/commands.c:91]: (style) The scope of the variable l can be limited [./src/jtag/commands.c:92]: (style) The scope of the variable f can be limited [./src/jtag/commands.c:90]: (style) struct or union member 'worse_case_align::i' is never used [./src/jtag/commands.c:91]: (style) struct or union member 'worse_case_align::l' is never used [./src/jtag/commands.c:92]: (style) struct or union member 'worse_case_align::f' is never used [./src/jtag/commands.c:93]: (style) struct or union member 'worse_case_align::v' is never used [./src/jtag/ft2232.c:1668]: (style) Redundant condition. It is safe to deallocate a NULL pointer [./src/jtag/ft2232.c:1687]: (style) Redundant condition. It is safe to deallocate a NULL pointer [./src/jtag/gw16012.c:399]: (style) Redundant condition. It is safe to deallocate a NULL pointer [./src/jtag/jlink.c:553]: (style) The scope of the variable jlink_max_size can be limited [./src/jtag/presto.c:759]: (style) Redundant condition. It is safe to deallocate a NULL pointer [./src/jtag/rlink/rlink.c:678]: (style) The scope of the variable bit_cnt can be limited [./src/jtag/rlink/rlink.c:679]: (style) The scope of the variable x can be limited [./src/jtag/rlink/rlink.c:681]: (style) The scope of the variable tdo_mask can be limited [./src/jtag/rlink/rlink.c:886]: (style) The scope of the variable retval can be limited [./src/jtag/rlink/rlink.c:1100]: (style) The scope of the variable saved_end_state can be limited [./src/jtag/usbprog.c:180]: (style) Redundant condition. It is safe to deallocate a NULL pointer [./src/jtag/usbprog.c:678]: (style) The scope of the variable i can be limited [./src/jtag/vsllink.c:778]: (style) The scope of the variable i can be limited [./src/jtag/vsllink.c:778]: (style) The scope of the variable tms_cmd_pos can be limited [./src/jtag/vsllink.c:958]: (style) The scope of the variable tms_append_byte can be limited [./src/jtag/vsllink.c:1178]: (style) The scope of the variable tms_tmp can be limited [./src/jtag/vsllink.c:1179]: (style) The scope of the variable i can be limited [./src/jtag/vsllink.c:1600]: (style) The scope of the variable i can be limited [./src/jtag/vsllink.c:1601]: (style) The scope of the variable result can be limited [./src/jtag/vsllink.c:1687]: (style) The scope of the variable byte_length can be limited [./src/jtag/vsllink.c:1688]: (style) The scope of the variable i can be limited [./src/jtag/vsllink.c:1689]: (style) The scope of the variable result can be limited [./src/pld/xilinx_bit.c:113]: (error) Resource leak: input_file [./src/server/gdb_server.c:1487]: (style) Redundant condition. It is safe to deallocate a NULL pointer [./src/server/gdb_server.c:711]: (style) The scope of the variable retval can be limited [./src/server/gdb_server.c:1376]: (style) The scope of the variable retval can be limited [./src/server/gdb_server.c:2020]: (style) The scope of the variable retval can be limited [./src/server/httpd.c:66]: (style) Redundant condition. It is safe to deallocate a NULL pointer [./src/server/httpd.c:187]: (style) struct or union member 'httpd_request::complete' is never used [./src/svf/svf.c:550]: (style) Redundant condition. It is safe to deallocate a NULL pointer [./src/svf/svf.c:788]: (style) The scope of the variable i can be limited [./src/svf/svf.c:791]: (style) The scope of the variable i_tmp can be limited [./src/svf/svf.c:794]: (style) The scope of the variable run_count can be limited [./src/svf/svf.c:795]: (style) The scope of the variable min_time can be limited [./src/svf/svf.c:795]: (style) The scope of the variable max_time can be limited [./src/svf/svf.c:801]: (style) The scope of the variable state can be limited [./src/target/arm11.c:139]: (style) struct or union member 'arm11_reg_defs_s::num' is never used [./src/target/arm11.c:141]: (style) struct or union member 'arm11_reg_defs_s::type' is never used [./src/target/arm11.c:1717]: (error) Memory leak: arm11 [./src/target/arm720t.c:505]: (style) The scope of the variable retval can be limited [./src/target/arm7_9_common.c:1841]: (style) The scope of the variable err can be limited [./src/target/arm7_9_common.c:2276]: (style) The scope of the variable thisrun_accesses can be limited [./src/target/arm7_9_common.c:2453]: (style) The scope of the variable thisrun_accesses can be limited [./src/target/arm7_9_common.c:2702]: (style) The scope of the variable i can be limited [./src/target/arm920t.c:1261]: (style) The scope of the variable retval can be limited [./src/target/arm920t.c:1320]: (style) The scope of the variable retval can be limited [./src/target/arm920t.c:914]: (error) Resource leak: output [./src/target/arm920t.c:1208]: (error) Resource leak: output [./src/target/arm966e.c:255]: (style) The scope of the variable retval can be limited [./src/target/arm9tdmi.c:984]: (style) The scope of the variable j can be limited [./src/target/arm_adi_v5.c:530]: (style) The scope of the variable nbytes can be limited [./src/target/arm_adi_v5.c:626]: (style) The scope of the variable nbytes can be limited [./src/target/arm_adi_v5.c:797]: (style) The scope of the variable nbytes can be limited [./src/target/arm_adi_v5.c:892]: (style) The scope of the variable nbytes can be limited [./src/target/arm_disassembler.c:3937]: (style) The scope of the variable immed can be limited [./src/target/arm_simulator.c:671]: (style) The scope of the variable i can be limited [./src/target/armv4_5_mmu.c:175]: (style) The scope of the variable va can be limited [./src/target/armv4_5_mmu.c:176]: (style) The scope of the variable pa can be limited [./src/target/cortex_a8.c:916]: (style) The scope of the variable retval can be limited [./src/target/cortex_a8.c:954]: (style) The scope of the variable retval can be limited [./src/target/cortex_a8.c:1042]: (style) The scope of the variable retval can be limited [./src/target/cortex_a8.c:1044]: (style) The scope of the variable control can be limited [./src/target/cortex_a8.c:1120]: (style) The scope of the variable retval can be limited [./src/target/cortex_m3.c:925]: (style) The scope of the variable retval can be limited [./src/target/cortex_m3.c:927]: (style) The scope of the variable hilo can be limited [./src/target/cortex_m3.c:995]: (style) The scope of the variable retval can be limited [./src/target/cortex_m3.c:1130]: (style) The scope of the variable temp can be limited [./src/target/cortex_m3.c:1282]: (style) The scope of the variable retval can be limited [./src/target/cortex_m3.c:1345]: (style) The scope of the variable retval can be limited [./src/target/cortex_m3.c:1503]: (style) The scope of the variable i can be limited [./src/target/embeddedice.c:278]: (style) The scope of the variable retval can be limited [./src/target/embeddedice.c:523]: (style) The scope of the variable retval can be limited [./src/target/image.c:444]: (style) The scope of the variable read_size can be limited [./src/target/image.c:445]: (style) The scope of the variable retval can be limited [./src/target/image.c:781]: (style) The scope of the variable retval can be limited [./src/target/mips32_pracc.c:446]: (style) The scope of the variable blocksize can be limited [./src/target/mips32_pracc.c:525]: (style) The scope of the variable blocksize can be limited [./src/target/mips_m4k.c:94]: (style) The scope of the variable retval can be limited [./src/target/mips_m4k.c:158]: (style) The scope of the variable retval can be limited [./src/target/mips_m4k.c:500]: (style) The scope of the variable retval can be limited [./src/target/mips_m4k.c:592]: (style) The scope of the variable retval can be limited [./src/target/target.c:1271]: (style) The scope of the variable i can be limited [./src/target/target.c:3732]: (style) The scope of the variable x can be limited [./src/target/target.c:3732]: (style) The scope of the variable y can be limited [./src/target/target.c:3732]: (style) The scope of the variable z can be limited [./src/target/target.c:4300]: (style) The scope of the variable e can be limited [./src/target/xscale.c:2153]: (style) The scope of the variable retval can be limited [./src/target/xscale.c:2257]: (style) The scope of the variable retval can be limited [./src/target/xscale.c:1950]: (error) Memory leak: buf32 [./src/xsvf/xsvf.c:330]: (style) Redundant condition. It is safe to deallocate a NULL pointer [./src/xsvf/xsvf.c:331]: (style) Redundant condition. It is safe to deallocate a NULL pointer [./src/xsvf/xsvf.c:332]: (style) Redundant condition. It is safe to deallocate a NULL pointer [./src/xsvf/xsvf.c:951]: (style) Redundant condition. It is safe to deallocate a NULL pointer [./src/xsvf/xsvf.c:954]: (style) Redundant condition. It is safe to deallocate a NULL pointer [./src/xsvf/xsvf.c:957]: (style) Redundant condition. It is safe to deallocate a NULL pointer Benjamin On Sunday 13 December 2009 23:22:24 David Brownell wrote: > On Sunday 13 December 2009, Carsten Breuer wrote: > > What I dislike most: > > > > Missing brackets: > > > > if (FOO_BAR) > > do_something > > > > It should be > > > > if (FOO_BAR) > > { > > do:something > > } > > For the record: I dislike the superfluous brackets. > > As Lennart noted, wasting vertical space is not good. > That's a case of taking 100% more lines than needed... > > There have certainly been cases where such wastage has > hidden bugs that would otherwise be visible just by > reading one screen's worth of code ... because it's > not as apparent what's going on when you need to flip > back and forth between two screens. > > > _______________________________________________ > Openocd-development mailing list > Openocd-development@lists.berlios.de > https://lists.berlios.de/mailman/listinfo/openocd-development > _______________________________________________ Openocd-development mailing list Openocd-development@lists.berlios.de https://lists.berlios.de/mailman/listinfo/openocd-development