Wireshark-dev: [Wireshark-dev] Re: warning C4702: unreachable code

From: Guy Harris <gharris@xxxxxxxxx>
Date: Tue, 3 Feb 2026 18:41:44 -0800
On Feb 3, 2026, at 3:14 AM, Tamás Regős <regost@xxxxxxxxx> wrote:

While I was trying to run some of the pipeline logic locally on my Windows machine related to my earlier emails and new MRs (!23460, !23461), I recompiled WS with some additional Visual Studio flags for clang checks and I can see a lots of "warning C4702: unreachable code".

Should these be addressed and fixed via MRs?

wireshark\epan\dissectors\packet-blip.c(323,1): warning C4702: unreachable code

As per Michael Mann, it's calling REPORT_DISSECTOR_BUG(), which calls proto_report_dissector_bug(), which is marked with WS_NORETURN, which should mark that routine as never returning.

And it does so for:

GCC 2.5 and later, or any compiler that claims to be (equivalent to) that (Clang, possible Intel C, possibly more);

SunOracle Studio C 5.9 or later;

IBM XL C 10.1 or later;

HP aCC 6.10 or later;

all versions of Visual Studio that we support.

but for all but Visual Studio, that's done with __attribute__((noreturn)), but with Visual Studio it's done with __declspec(noreturn).

When you say "with some additional Visual Studio flags for clang checks", does that involve a version of Visual Studio C/C++ with a combination of Clang code and VS code, e.g. a Clang front end? If so, it might be using a "does not return" indication that the compiler doesn't recognize.

Also, what are the additional flags you used?