ANNOUNCEMENT: Live Wireshark University & Allegro Packets online APAC Wireshark Training Session
April 17th, 2024 | 14:30-16:00 SGT (UTC+8) | Online

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

From: Ulf Lamping <ulf.lamping@xxxxxx>
Date: Tue, 07 Nov 2006 09:56:11 +0100
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