Wireshark-dev: Re: [Wireshark-dev] Replace ntohl() with g_ntohl() -> automated check?

Date: Tue, 7 Nov 2006 12:57:59 +0000
what about #defining them so they trigger an error?

On 11/7/06, Ulf Lamping <ulf.lamping@xxxxxx> wrote:
Jaap Keuter wrote:
> Hi,
>
> Checked in.
>
> Thanx,
> Jaap
>
>
> On Mon, 6 Nov 2006, Albert Chin wrote:
>
>
>> Patch attached to convert usage of ntohl() -> g_ntohl(). On HP-UX,
>> ntohl() isn't available unless you -D_XOPEN_SOURCE_EXTENDED but there
>> are other uses of g_ntohl().
>>
>> --
>> albert chin (china@xxxxxxxxxxxxxxxxxx)
>>
Hi List!

It seems that we get more and more "keywords" known to be better not
used in our code (or at least not in the dissector part).

I think for example of:
- printf
- perror
- sprintf
- ntohl
- ... and there might be a lot more!

Would it be possible to have some simple static code analysis tools to
prevent such calls?

Of course, it shouldn't trigger on these keywords inside of strings and
comments, so a simple text search might not be the way to go.

Any thoughts for a simple but solid solution, which could be integrated
into the buildbot?

Regards, ULFL
_______________________________________________
Wireshark-dev mailing list
Wireshark-dev@xxxxxxxxxxxxx
http://www.wireshark.org/mailman/listinfo/wireshark-dev



--
This information is top security. When you have read it, destroy yourself.
-- Marshall McLuhan