This is a static archive of our old Q&A Site. Please post any new questions and answers at ask.wireshark.org.

How to stop treating warnings as errors

0

I've gotten to the point in my custom Wireshark build for Windows that all that's left now is warnings--but these warnings are being treated as errors. As the vast majority of them are harmless (unused variabled, for example) is there any way to set it so that warnings are not treated as errors?

asked 21 Jan '15, 05:41

mehubb985's gravatar image

mehubb985
118810
accept rate: 0%


2 Answers:

2

For Windows nmake builds, edit the following part of config.nmake as described in the comment:

#Comment out the following if warnings are not to be treated as errors
WARNINGS_ARE_ERRORS=-WX

As Jaap says though, there should be no warnings, all of the core Wireshark code is expected to build without any warnings and your custom code should too.

You might also run the perl check* scripts in tools, as they also pick up errors.

answered 21 Jan '15, 06:21

grahamb's gravatar image

grahamb ♦
19.8k330206
accept rate: 22%

1

Have a look at this configure option --enable-warnings-as-errors. Assigning it 'no' should prevent them from happening. But even better, clean up your code to get rid of them, if you can.

answered 21 Jan '15, 06:00

Jaap's gravatar image

Jaap ♦
11.7k16101
accept rate: 14%

If a variable is reported as unused, either 1) it's not useful and should be removed or 2) it is useful and there's a typo or some other sort of bug in your code that means it's not being used when it should be.

That's why the Wireshark buildbots turn on warnings-as-errors whenever possible.

(22 Jan '15, 16:05) Guy Harris ♦♦