Huge thanks to our Platinum Members Endace and LiveAction,
and our Silver Member Veeam, for supporting the Wireshark Foundation and project.

Wireshark-dev: Re: [Wireshark-dev] Prevent compiler warnings by using "stop on warnings"/"treat

From: Ulf Lamping <ulf.lamping@xxxxxx>
Date: Tue, 20 Mar 2007 04:25:29 +0100
Guy Harris wrote:
The main reason for warnings you can't eliminate, I suspect, are crufty vendor #include headers. At least some versions of Solaris have, as I remember, crappy old X11 headers that don't have function prototypes by default, hence the hack to turn them on in configure.in, and some don't declare a return type even with -DFUNCPROTO=15.
The same problem is with Windows headers and warning level 4 :-(

You can do some #pragma warning magic for MSVC to get around this, but that's ugly.
If there are vendor headers that can't be worked around in a fashion such as that, some platforms might have a problem.

If all else fails, we could leave the "stop on warnings" option off on that platform.
Ack. But I guess if we fix all warnings on the current buildbot platforms, this will reduce the current huge amount of warnings to a much better level even for the other platforms.
Another issue is that a lot of code is automatically generated; I suspect both asn2wrs and the PIDL generator need to be fixed to decorate function arguments with _U_, or to leave the arguments out, or to generate code that uses them.

For some reason, a lot of asn2wrs-generated files appear to generate a bunch of unused functions; I don't know if that's an asn2wrs problem or a problem with the ASN.1 being processed.
Yes, that's one of the many steps to take.

Unfortunately, I'm not very familiar with asn2wrs and the PIDL generator and will need some help on this ...
I think it's at least worth trying.
As you're one of the developers actually fixing warnings I thought that you would give it a try ;-)

Regards, ULFL