Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Compiling 'Packet32.cpp' with '-std:c++20'

Open
#752 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
42/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
cpp

Research direction

Reproduce the failure from packetWin7\Dll\Project with MSBuild and MSVC 19.42 using CL=-std:c++20, then inspect the reported declarations and goto labels in packetWin7/Dll/Packet32.cpp. Compare the MSVC result with clang-cl 18.1. Done means Packet.sln builds for x64 Release under C++20 or C++latest without the listed C2362 errors.

Written by the indexing model from the issue text.

Description

The default C++ standard in cl is C++14. And using that for packetWin7/Dll/Packet32.cpp works fine.
But using -std:c++20 or -std:c++latest does not. This is what I did:

cd packetWin7\Dll\Project
set CL=-std:c++20
msbuild -nologo -p:Configuration=Release -p:Platform="x64" Packet.sln

The errors generated by MSVC version 19.42.34321.1 for x64 (the latest):

Packet32.cpp(414): error C2362: initialization of 'nFields' is skipped by 'goto Exit'
Packet32.cpp(422): note: see declaration of 'Exit'
Packet32.cpp(3369): error C2362: initialization of 'numEntries' is skipped by 'goto END_PacketGetNetInfoEx'
Packet32.cpp(3417): note: see declaration of 'END_PacketGetNetInfoEx'
Packet32.cpp(3368): error C2362: initialization of 'pAddr' is skipped by 'goto END_PacketGetNetInfoEx'
Packet32.cpp(3417): note: see declaration of 'END_PacketGetNetInfoEx'
Packet32.cpp(3314): error C2362: initialization of 'RetVal' is skipped by 'goto END_PacketGetNetInfoEx'
Packet32.cpp(3417): note: see declaration of 'END_PacketGetNetInfoEx'
Packet32.cpp(3301): error C2362: initialization of 'AdapterGuid' is skipped by 'goto END_PacketGetNetInfoEx'
Packet32.cpp(3417): note: see declaration of 'END_PacketGetNetInfoEx'

Googling this issue seems to be related to option /Za which is not in use.

And further, using -std:c++20 or -std:c++latest with clang-cl ver. 18.1 works just fine.
So I'm not sure what is the real issue with the Packet32.cpp code.

Dominant language
C
Stars
3.6k
Forks
592
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from nmap/npcap

All issues in nmap/npcap

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.