-
Notifications
You must be signed in to change notification settings - Fork 795
Open
Labels
CoveritybugSomething isn't workingSomething isn't workingconfirmedgood first issueGood for newcomersGood for newcomers
Description
See Coverity issues at https://scan.coverity.com/projects/intel-llvm?tab=analysis_settings
CID 437235
:
std::string_view PrinterType(std::getenv("SYCL_TRACE_PRINT_FORMAT")); |
CID 442884
:
std::string_view PrinterType(std::getenv("SYCL_TRACE_PRINT_FORMAT")); |
CID 440717
:
std::string_view PrinterType(std::getenv("SYCL_TRACE_PRINT_FORMAT")); |
CID 437184
:
std::string_view PrinterType(std::getenv("SYCL_TRACE_PRINT_FORMAT")); |
The problem here is that string_view(nullptr)
behavior is not defined.
string_veiw(const chatT *str)
constructor has a precondition that [str, str + char_traits<charT>::length(str))
is a valid range (string.view.cons.2).
length
is defined by char.traits.require as:
Returns: the smallest
i
such thatX::eq(p[i],charT())
is true.
When there is no such i
when p
is nullptr
. See also p0903r0
string_view(nullptr)
constructor is explicitly deleted in C++23: cppreference.
Metadata
Metadata
Assignees
Labels
CoveritybugSomething isn't workingSomething isn't workingconfirmedgood first issueGood for newcomersGood for newcomers