Closed
Description
Picked up by clang --analyze
:
In file included from
include/concurrent/AtomicBuffer.h:25:
include/util/StringUtil.h:146:13: warning: The right operand of '==' is a garbage value
if ('y' == response || 'Y' == response)
^ ~~~~~~~~
And it's not wrong:
inline bool continuationBarrier(const std::string& label)
{
bool result = false;
char response;
std::cout << std::endl << label << " (y/n): ";
std::cin >> response; // <--------- if the cin fails here (e.g. stdin has been closed), response will be left uninitialised
if ('y' == response || 'Y' == response)
{
result = true;
}
return result;
}
Metadata
Metadata
Assignees
Labels
No labels