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

From: Tamás Regős <regost@xxxxxxxxx>
Date: Wed, 4 Feb 2026 09:06:45 +0700
Hi Michael,

You are right, I agree with you.
I also checked some of those and came to the same conclusion. The MSVC does not seem to be able to properly "see thru" the macros.

No more extra MSVC flags :)

Thank you.

Regards,
Tamas

On Tue, 3 Feb 2026 at 23:41, Michael Mann via Wireshark-dev <wireshark-dev@xxxxxxxxxxxxx> wrote:
I looked at the first example (packet-blip.c) and it's using a macro to throw an exception, then returns NULL (the "return" is considered the "unreachable code")
Not sure if the macro is build configuration dependent (Debug vs Release), but I'm fine with the style of code used there and it's probably why we don't use the additional Visual Studio flags you enabled.



On Tuesday, February 3, 2026 at 06:14:49 AM EST, Tamás Regős <regost@xxxxxxxxx> wrote:


Hi Dev Team,

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
wireshark\epan\dissectors\packet-cbor.c(390,1): warning C4702: unreachable code
wireshark\epan\dissectors\packet-cbor.c(501,1): warning C4702: unreachable code
wireshark\epan\dissectors\packet-catapult-dct2000.c(3402,1): warning C4702: unreachable code
wireshark\epan\dissectors\packet-cip.c(6610,1): warning C4702: unreachable code
wireshark\epan\dissectors\packet-dof.c(5814,1): warning C4702: unreachable code
wireshark\epan\dissectors\packet-exported_pdu.c(215,1): warning C4702: unreachable code
wireshark\epan\dissectors\packet-fpp.c(307,1): warning C4702: unreachable code
wireshark\epan\dissectors\packet-h223.c(1157,1): warning C4702: unreachable code
wireshark\epan\dissectors\packet-h223.c(1169,1): warning C4702: unreachable code
wireshark\epan\dissectors\packet-h223.c(1095,1): warning C4702: unreachable code
wireshark\epan\dissectors\packet-http.c(996,1): warning C4702: unreachable code
wireshark\epan\dissectors\packet-ieee80211.c(39522,1): warning C4702: unreachable code
wireshark\epan\dissectors\packet-ipsec.c(1296,1): warning C4702: unreachable code
wireshark\epan\dissectors\packet-ipsec.c(1094,1): warning C4702: unreachable code
wireshark\epan\dissectors\packet-ipsec.c(1886,1): warning C4702: unreachable code
wireshark\epan\dissectors\packet-ipsec.c(1925,1): warning C4702: unreachable code
wireshark\epan\dissectors\packet-ipsec.c(1951,1): warning C4702: unreachable code
wireshark\epan\dissectors\packet-ipsec.c(1972,1): warning C4702: unreachable code
wireshark\epan\dissectors\packet-ipsec.c(2019,1): warning C4702: unreachable code
wireshark\epan\dissectors\packet-ipsec.c(2057,1): warning C4702: unreachable code
wireshark\epan\dissectors\packet-ipsec.c(2080,1): warning C4702: unreachable code
wireshark\epan\dissectors\packet-ipsec.c(2116,1): warning C4702: unreachable code
wireshark\epan\dissectors\packet-ipsec.c(2137,1): warning C4702: unreachable code
wireshark\epan\dissectors\packet-ipsec.c(2160,1): warning C4702: unreachable code
wireshark\epan\dissectors\packet-iso15765.c(1013,1): warning C4702: unreachable code
wireshark\epan\dissectors\packet-iuup.c(721,1): warning C4702: unreachable code
wireshark\epan\dissectors\packet-megaco.c(293,1): warning C4702: unreachable code
wireshark\epan\dissectors\packet-mtp3.c(250,1): warning C4702: unreachable code
wireshark\epan\dissectors\packet-mtp3.c(272,1): warning C4702: unreachable code
wireshark\epan\dissectors\packet-mtp3.c(277,1): warning C4702: unreachable code
wireshark\epan\dissectors\packet-mswsp.c(4064,1): warning C4702: unreachable code
wireshark\epan\dissectors\packet-mswsp.c(4953,1): warning C4702: unreachable code
wireshark\epan\dissectors\packet-netlink-netfilter.c(2064,1): warning C4702: unreachable code
wireshark\epan\dissectors\packet-netlink-netfilter.c(2150,1): warning C4702: unreachable code
wireshark\epan\dissectors\packet-netlink-netfilter.c(2226,1): warning C4702: unreachable code
wireshark\epan\dissectors\packet-netlink-netfilter.c(2254,1): warning C4702: unreachable code
wireshark\epan\dissectors\packet-netlink-netfilter.c(2450,1): warning C4702: unreachable code
wireshark\epan\dissectors\packet-netlink-netfilter.c(2095,1): warning C4702: unreachable code
wireshark\epan\dissectors\packet-netlink-netfilter.c(2176,1): warning C4702: unreachable code
wireshark\epan\dissectors\packet-netlink-netfilter.c(1529,1): warning C4702: unreachable code
wireshark\epan\dissectors\packet-netlink-netfilter.c(2403,1): warning C4702: unreachable code
wireshark\epan\dissectors\packet-netlink-netfilter.c(2428,1): warning C4702: unreachable code
wireshark\epan\dissectors\packet-netlink-netfilter.c(2522,1): warning C4702: unreachable code
wireshark\epan\dissectors\packet-null.c(312,1): warning C4702: unreachable code
wireshark\epan\dissectors\packet-obd-ii.c(1500,1): warning C4702: unreachable code
wireshark\epan\dissectors\packet-obd-ii.c(1459,1): warning C4702: unreachable code
wireshark\epan\dissectors\packet-obd-ii.c(1502,1): warning C4702: unreachable code
wireshark\epan\dissectors\packet-oer.c(520,1): warning C4702: unreachable code
wireshark\epan\dissectors\packet-oer.c(646,1): warning C4702: unreachable code
wireshark\epan\dissectors\packet-oer.c(652,1): warning C4702: unreachable code
wireshark\epan\dissectors\packet-oer.c(695,1): warning C4702: unreachable code
wireshark\epan\dissectors\packet-per.c(375,1): warning C4702: unreachable code
wireshark\epan\dissectors\packet-per.c(392,1): warning C4702: unreachable code
wireshark\epan\dissectors\packet-per.c(431,1): warning C4702: unreachable code
wireshark\epan\dissectors\packet-per.c(462,1): warning C4702: unreachable code
wireshark\epan\dissectors\packet-per.c(474,1): warning C4702: unreachable code
wireshark\epan\dissectors\packet-per.c(534,1): warning C4702: unreachable code
wireshark\epan\dissectors\packet-per.c(1213,1): warning C4702: unreachable code
wireshark\epan\dissectors\packet-per.c(1272,1): warning C4702: unreachable code
wireshark\epan\dissectors\packet-per.c(2109,1): warning C4702: unreachable code
wireshark\epan\dissectors\packet-per.c(917,1): warning C4702: unreachable code
wireshark\epan\dissectors\packet-ppp.c(1829,1): warning C4702: unreachable code
wireshark\epan\dissectors\packet-pw-atm.c(281,1): warning C4702: unreachable code
wireshark\epan\dissectors\packet-pw-atm.c(309,1): warning C4702: unreachable code
wireshark\epan\dissectors\packet-pw-atm.c(285,1): warning C4702: unreachable code
wireshark\epan\dissectors\packet-pw-atm.c(314,1): warning C4702: unreachable code
wireshark\epan\dissectors\packet-pw-atm.c(354,1): warning C4702: unreachable code
wireshark\epan\dissectors\packet-quic.c(3687,1): warning C4702: unreachable code
wireshark\epan\dissectors\packet-reload.c(1880,1): warning C4702: unreachable code
wireshark\epan\dissectors\packet-reload.c(1868,1): warning C4702: unreachable code
wireshark\epan\dissectors\packet-rsvp.c(2651,1): warning C4702: unreachable code
wireshark\epan\dissectors\packet-rsvp.c(2709,1): warning C4702: unreachable code
wireshark\epan\dissectors\packet-rtps.c(12951,1): warning C4702: unreachable code
wireshark\epan\dissectors\packet-sll.c(209,1): warning C4702: unreachable code
wireshark\epan\dissectors\packet-sll.c(235,1): warning C4702: unreachable code
wireshark\epan\dissectors\packet-snort.c(1340,1): warning C4702: unreachable code
wireshark\epan\dissectors\packet-snort.c(1341,1): warning C4702: unreachable code
wireshark\epan\dissectors\packet-snort.c(1353,1): warning C4702: unreachable code
wireshark\epan\dissectors\packet-snort.c(1358,1): warning C4702: unreachable code
wireshark\epan\dissectors\packet-snort.c(1363,1): warning C4702: unreachable code
wireshark\epan\dissectors\packet-spice.c(1526,1): warning C4702: unreachable code
wireshark\epan\dissectors\packet-ssh.c(2028,1): warning C4702: unreachable code
wireshark\epan\dissectors\packet-ssh.c(2090,1): warning C4702: unreachable code
wireshark\epan\dissectors\packet-wcp.c(628,1): warning C4702: unreachable code
wireshark\epan\dissectors\packet-xcp.c(1780,1): warning C4702: unreachable code
wireshark\epan\dissectors\packet-xcp.c(2755,1): warning C4702: unreachable code
wireshark\epan\dissectors\packet-xcp.c(3022,1): warning C4702: unreachable code
wireshark\epan\dissectors\packet-xcp.c(1864,1): warning C4702: unreachable code
wireshark\epan\dissectors\packet-acse.c(1649,1): warning C4702: unreachable code
wireshark\epan\dissectors\packet-camel.c(3327,1): warning C4702: unreachable code
wireshark\epan\dissectors\packet-charging_ase.c(511,1): warning C4702: unreachable code
wireshark\epan\dissectors\packet-h248.c(1044,1): warning C4702: unreachable code
wireshark\epan\dissectors\packet-spnego.c(328,1): warning C4702: unreachable code
wireshark\epan\dissectors\packet-dcerpc-nt.c(1026,1): warning C4702: unreachable code
wireshark\epan\dissectors\packet-ncp2222.inc(7023,1): warning C4702: unreachable code

Regards,
Tamas
_______________________________________________
Wireshark-dev mailing list -- wireshark-dev@xxxxxxxxxxxxx
To unsubscribe send an email to wireshark-dev-leave@xxxxxxxxxxxxx
_______________________________________________
Wireshark-dev mailing list -- wireshark-dev@xxxxxxxxxxxxx
To unsubscribe send an email to wireshark-dev-leave@xxxxxxxxxxxxx