Øyvind Harboe a écrit : > On Sun, Dec 13, 2009 at 3:04 PM, Albert ARIBAUD <albert.arib...@free.fr> > wrote: >> Øyvind Harboe a écrit : >> >>>> -Wall is the minimum that should be applied to source code. Running it >>>> through Splint (or some other verification tool) would not hurt either. >>> Is there an open source lint tool that's worthwhile to use? >>> >>> Did you try splint on OpenOCD? >> Apart from Splint, I haven't used open source verification tools (but I do >> use a non-open source one in my day job). And no, I haven't tried splint on >> it, although I could give it a try if you want. > > I think a report on the results and possibly a patch to use it would > be well received.
Long story short, to get as far as possible with splint, I had to run splint +posixlib -preproc -I src/helper -I src/jtag -I src/svf `find . -name *.c` at the root directory of my openOCD source tree (which is a bit behind the curent git right now), and this gives: > Splint 3.1.2 --- 08 Sep 2009 > > > src/target/mips32_pracc.c:380:51: Comment starts inside comment > A comment open sequence (/*) appears within a comment. This usually means > an > earlier comment was not closed. (Use -nestcomment to inhibit warning) > > src/target/mips32_pracc.c:381:137: Comment starts inside comment > > src/target/mips32_pracc.c:442:27: Comment starts inside comment > src/target/mips32_pracc.c:523:27: Comment starts inside comment > src/target/mips32_pracc.c:595:75: Comment starts inside comment > src/target/mips32_pracc.c:603:76: Comment starts inside comment > src/target/mips32_pracc.c:604:94: Comment starts inside comment > src/target/mips32_pracc.c:610:53: Comment starts inside comment > src/helper/types.h: (in function h_u32_to_le) > src/helper/types.h:136:22: Left operand of >> may be negative (int): val >> 24 > The left operand to a shift operator may be negative (behavior is > implementation-defined). (Use -shiftimplementation to inhibit warning) > src/helper/types.h:137:22: Left operand of >> may be negative (int): val >> 16 > src/helper/types.h:138:22: Left operand of >> may be negative (int): val >> 8 > src/helper/types.h:139:22: Left operand of >> may be negative (int): val >> 0 > src/helper/types.h: (in function h_u32_to_be) > src/helper/types.h:144:22: Left operand of >> may be negative (int): val >> 24 > src/helper/types.h:145:22: Left operand of >> may be negative (int): val >> 16 > src/helper/types.h:146:22: Left operand of >> may be negative (int): val >> 8 > src/helper/types.h:147:22: Left operand of >> may be negative (int): val >> 0 > src/helper/types.h: (in function h_u16_to_le) > src/helper/types.h:152:22: Left operand of >> may be negative (int): val >> 8 > src/helper/types.h:153:22: Left operand of >> may be negative (int): val >> 0 > src/helper/types.h: (in function h_u16_to_be) > src/helper/types.h:158:22: Left operand of >> may be negative (int): val >> 8 > src/helper/types.h:159:22: Left operand of >> may be negative (int): val >> 0 > src/helper/binarybuffer.h:52:16: Parse Error. (For help on parse errors, see > splint -help parseerrors.) > *** Cannot continue. Note splint died long before it could go through most of the code. Also note splint has not been updated for a long time, as I discovered when going to its home site. Amicalement, -- Albert. _______________________________________________ Openocd-development mailing list Openocd-development@lists.berlios.de https://lists.berlios.de/mailman/listinfo/openocd-development