Viladoman / StructLayout

Visual Studio Extension for C++ struct memory layout visualization
MIT License
477 stars 22 forks source link

Error parsing intrin.h, included by other standard headers #19

Closed amzeratul closed 3 years ago

amzeratul commented 3 years ago

I've recently started getting this issue on any data structure that I try seeing the layout of:

[12:02:59] Capturing configuration from VS projects...
[12:02:59] Looking for structures at C:\dev\halley\src\engine\utils\include\halley\data_structures\maybe.h:17:14...
[12:02:59] COMMAND LINE: C:\dev\halley\src\engine\utils\include\halley\data_structures\maybe.h -- -x c++ -m64 -std=c++17 -w -DWIN32 -D_WINDOWS -D_ENABLE_EXTENDED_ALIGNED_STORAGE -DGSL_THROW_ON_CONTRACT_VIOLATION -DDEV_BUILD -D_WIN32_WINNT=0x0601 -DWINVER=0x0601 -D_SILENCE_ALL_CXX17_DEPRECATION_WARNINGS -DWITH_SDL2 -DBOOST_ALL_NO_LIB -DBOOST_CONFIG_SUPPRESS_OUTDATED_MESSAGE -DWITH_OPENGL -DWITH_ASIO -DWITH_DX11 -DWITH_MEDIA_FOUNDATION -DCMAKE_INTDIR=\"Debug\" -IC:\dev\halley\src\contrib -IC:\dev\halley\src\engine\utils\include -IC:\dev\halley\src\engine\utils\..\core\include -IC:\dev\halley\src\engine\utils\..\..\contrib\yaml-cpp\include -IC:\dev\halley_deps\Boost\include\boost-1_72 -working-directory=C:\dev\build\halley\src\engine\utils -std=c++17
[12:02:59] Execution Log:
In file included from C:\dev\halley\src\engine\utils\include\halley\data_structures\maybe.h:3:
In file included from C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\include\optional:18:
In file included from C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\include\xmemory:13:
In file included from C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\include\limits:14:
In file included from C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\include\intrin0.h:18:
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\include\intrin.h:56:1: error: expected function body after function declarator
__MACHINE(void * _AddressOfReturnAddress(void))
^
1 error generated.
Error while processing C:\dev\halley\src\engine\utils\include\halley\data_structures\maybe.h.

[12:02:59] [ERROR] Unable to scan the given location. (241.0200 ms)

It seems that pretty much any standard header eventually includes intrin.h, which causes that issue.

The extension used to work fine on this project, so it was either a recent update or updating Visual Studio to 16.8.2 (sorry, those two things happened at the same time, not sure who's at fault).

Viladoman commented 3 years ago

Sadly, this is a regression with Visual Studio. There isn't much I can do on my end a part from waiting and hoping the submitted fix for 16.9 works.

amzeratul commented 3 years ago

Thanks for letting me know! The diff provided on that thread serves as a workaround for me.

Zingam commented 3 years ago

New VS was released this week.

DJLink commented 3 years ago

New VS was released this week.

New VS version fixed this bug for me, I can use it normally now.

Viladoman commented 3 years ago

Thanks @Zingam and @DJLink for validating with the latest VS release!