Skip to content
This repository has been archived by the owner on Sep 13, 2022. It is now read-only.

Build error with KTL #1

Open
JonCavesMSFT opened this issue Aug 21, 2019 · 1 comment
Open

Build error with KTL #1

JonCavesMSFT opened this issue Aug 21, 2019 · 1 comment

Comments

@JonCavesMSFT
Copy link

JonCavesMSFT commented Aug 21, 2019

Hi: we have recently updated the Microsoft Visual C++ compiler to give an error if a template parameter is shadowed by a function parameter - previous versions of the compiler did not detect this error, which, in some cases led to a compiler crash. Unfortunately KTL is failing to build with the new compiler because it appears to reference an old (very old?) version of the Windows SDK (and hence the CRT). If we use a new compiler we are seeing the following error:

D:\CoreXTCache\Microsoft.WindowsAzure.DirectDrive.External.Windows.sdk.10.0.14296\inc\crt\wchar.h(642): error C7576: declaration of '_Size' shadows a template parameter
D:\CoreXTCache\Microsoft.WindowsAzure.DirectDrive.External.Windows.sdk.10.0.14296\inc\crt\wchar.h(642): note: see declaration of '_Size'

This is due to this function declaration:

errno_t __cdecl _cgetws_s(wchar_t* _Buffer, size_t _SizeInWords, size_t* _SizeRead);

extern "C++"
{
        template<size_t _Size>
	inline errno_t __cdecl _cgetws_s(wchar_t (&_Buffer)[_Size], size_t* _Size)
	{
		return _cgetws_s(_Buffer, _Size, _Size);
	}
}

The definition of _cgetws_s should be:

        template<size_t _Size>
	inline errno_t __cdecl _cgetws_s(wchar_t (&_Buffer)[_Size], size_t* _SizeRead)
	{
		return _cgetws_s(_Buffer, _Size, _SizeRead);
	}

and this is what newer versions of the SDK (and hence the Unified CRT) include.

Thanks
Jonathan Caves

@loneicewolf
Copy link

@JonCavesMSFT Thanks for the info!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants