Wireshark-dev: Re: [Wireshark-dev] Replace ntohl() with g_ntohl() -> automated check?
From: Ulf Lamping <[email protected]>
Date: Thu, 16 Nov 2006 01:38:21 +0100
Hi Jeff!

First of all, a big thank you to take some time to look at this topic. I guess the only way to improve the current situation is to find an automated way to find stuff like this and your approach looks promissing.
Although my perl knowledge is very limited, I was able to read and 
understand your script as it is well documented (I really appreciate this).
Jeff Morriss wrote:
Perl is built for this kind of thing. :-)
And I thought it was build to analyze log files ;-)
It requires an extra step, but the code to do it is quite easy, see 
attached.  This program has 2 lists: a list of prohibited APIs that 
must not be used (or the program will return an error) and a list of 
deprecated APIs that, if they are used, only generate a warning.
Sounds good.
Does Subversion have the concept of a check-in trigger?  E.g., before 
accepting the check-in it runs a script and if the script returns an 
error, the check-in fails?  Could be done there, though that's a bit 
aggressive ;-).
To be honest - I don't know. Gerald, do you have an idea (if it's possible and if we probably want to have it that way)?
Or "make codecheck" or something else...
A combination of a make/nmake target and the buildbot might be a good start for further experiments.
Of course the lists I put are just some basics for testing.  And maybe 
the lists need to be different for dissectors vs. core Wireshark, 
etc., but the concept is there.  
... and it's looking exactly what I was thinking about :-)

I guess we need some ideas where to apply which policy. I would like to start with the epan dir as this is usually the most critical part of the code.
I even put a Copyright notice in case it's a good enough start.  :-)
The only thing I'm a bit concerned about is if your script will fail on "more sophisticated" combinations of C code, e.g. a comment with a string in it and such - well, you get the point.

So a start was made - any opinions if this is the way to go?

Regards, ULFL