Compiling 'Packet32.cpp' with '-std:c++20'
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 3.6k
- Forks
- 592
- PR merge metrics
- No merged PRs in 30d
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.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
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.
Assessment
- Tech stack
- cpp
- Domain
- networking, operating-systems
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100