[llvm-bugs] [Bug 43558] New: Compiled with clang-cl -fsanitize=address /MD std::strtol does not change errno correctly

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Oct 4 02:29:39 PDT 2019


https://bugs.llvm.org/show_bug.cgi?id=43558

            Bug ID: 43558
           Summary: Compiled with clang-cl -fsanitize=address /MD
                    std::strtol does not change errno correctly
           Product: clang
           Version: 9.0
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: predelnik at gmail.com
                CC: blitzrakete at gmail.com, dgregor at apple.com,
                    erik.pilkington at gmail.com, llvm-bugs at lists.llvm.org,
                    richard-llvm at metafoo.co.uk

The following example prints 0 if both -fsanitize=address and /MD are passed as
arguments:

#include <cstdlib>
#include <iostream>

int main ()
{
  char *eptr;
  auto value = std::strtol ("99999999999999999999999999999999999999999", &eptr,
10);
  std::cout << errno << '\n';
}

The correct result is printing 34 (ERANGE)

I have checked that the rest of this funciton family (stdtoul, strtoll,
strtoull, strtof, strtod, strtold) are not affected which makes this problem
strangely specific to strtol.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20191004/92933fea/attachment-0001.html>


More information about the llvm-bugs mailing list