Re: [Yaffs] Static code analysis hints

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: James Kehl
Date:  
To: Charles Manning, yaffs
Subject: Re: [Yaffs] Static code analysis hints
> -----Original Message-----
> From: [mailto:yaffs-
> ] On Behalf Of Charles Manning
> Sent: Wednesday, 16 December 2009 2:27 PM
> To:
> Subject: [Yaffs] Static code analysis hints
>
> Hello All
>
> In the interests of continued yaffs improvement I'm looking into

static
> code analysis tools.
>
> I know yaffs has some poor signed/unsigned mixing that has caused

issues
> in the past and is (hopefully) currently benign. I would, however like
> to improve things by running the code through checkers.
>


If signed/unsigned mixing is a worry, what about the GCC flags "-Wall
-W" (I'm thinking of "-Wsign-compare" in particular)?

> I looked at splint, but it seems to get quite upset about legal

constructs
> such as the doubly linked list code. I am a bit concerned that once

all
> the noisy flags are turned off the test is not really doing anything.
> You can turn these flags on/off by using decorated comments, but that

makes
> the code pretty ugly.
>
> Any hints appreciated.
>


Yaffs, as kernel code, does not have the same set of constraints as an
average userland program - for instance, you assume
-fno-strict-aliasing, and I'd think every decent static checker would
complain about the code that relies on that (and it's bitten me, grumble
grumble) - but you're not realistically worried about that.

What about the Linux kernel checker, sparse? Granted, the address-space
and locking-order checks won't be all that great for Yaffs, but will the
rest help?

J