When using Intel C++ Compiler on Windows, I got the following warnings (handled as errors on my project):
gsl/span(301): error #3924: attribute namespace "gsl" is unrecognized
GSL_SUPPRESS(bounds.1) // NO-FORMAT: attribute
^
gsl/span(301): remark #1292: unknown attribute "gsl::suppress"
GSL_SUPPRESS(bounds.1) // NO-FORMAT: attribute
^
It seems that the problem lies in the GSL_SUPPRESS() macro definition:
// gsl_assert, l. 45-53 (also in gsl_bype):
#if defined(__clang__)
#define GSL_SUPPRESS(x) [[gsl::suppress("x")]]
#else
#if defined(_MSC_VER)
#define GSL_SUPPRESS(x) [[gsl::suppress(x)]]
#else
#define GSL_SUPPRESS(x)
#endif // _MSC_VER
#endif // __clang__
Intel C++ compiler defines the _MSC_VER macro on Windows, so it falls into the second #define case.
Perhaps it could be changed to something like
#if defined(_MSC_VER) && ! defined(__INTEL_COMPILER)
#define GSL_SUPPRESS(x) [[gsl::suppress(x)]]
to avoid such warnings.
My test environment:
- Intel C++ Compiler 19.1.2
- MSVC 19.26
When using Intel C++ Compiler on Windows, I got the following warnings (handled as errors on my project):
It seems that the problem lies in the
GSL_SUPPRESS()macro definition:Intel C++ compiler defines the
_MSC_VERmacro on Windows, so it falls into the second#definecase.Perhaps it could be changed to something like
to avoid such warnings.
My test environment: