Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

_STL_VERIFY shouldn't emit long strings for function names #2054

Merged
merged 4 commits into from
Jul 30, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions stl/inc/yvals.h
Original file line number Diff line number Diff line change
Expand Up @@ -164,10 +164,18 @@ _STL_DISABLE_CLANG_WARNINGS
#error _ITERATOR_DEBUG_LEVEL != 0 must imply _CONTAINER_DEBUG_LEVEL == 1.
#endif // _ITERATOR_DEBUG_LEVEL != 0 && _CONTAINER_DEBUG_LEVEL == 0

#define _STL_REPORT_ERROR(mesg) \
do { \
_RPTF0(_CRT_ASSERT, mesg); \
_CRT_SECURE_INVALID_PARAMETER(mesg); \
#ifndef _STL_CRT_SECURE_INVALID_PARAMETER
#ifdef _DEBUG // avoid emitting unused long strings for function names; see GH-1956
#define _STL_CRT_SECURE_INVALID_PARAMETER(expr) ::_invalid_parameter(_CRT_WIDE(#expr), L"", __FILEW__, __LINE__, 0)
#else // _DEBUG
#define _STL_CRT_SECURE_INVALID_PARAMETER(expr) _CRT_SECURE_INVALID_PARAMETER(expr)
#endif // _DEBUG
#endif // _STL_CRT_SECURE_INVALID_PARAMETER

#define _STL_REPORT_ERROR(mesg) \
do { \
_RPTF0(_CRT_ASSERT, mesg); \
_STL_CRT_SECURE_INVALID_PARAMETER(mesg); \
} while (false)

#ifdef __clang__
Expand Down