[all-commits] [llvm/llvm-project] 72f6df: [libc][windows] fix strlcpy tests

michaelrj-google via All-commits all-commits at lists.llvm.org
Wed May 18 14:12:05 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 72f6dfb378751fd48bcd70fefd57e7a31bea501d
      https://github.com/llvm/llvm-project/commit/72f6dfb378751fd48bcd70fefd57e7a31bea501d
  Author: Michael Jones <michaelrj at google.com>
  Date:   2022-05-18 (Wed, 18 May 2022)

  Changed paths:
    M libc/test/src/string/strlcpy_test.cpp

  Log Message:
  -----------
  [libc][windows] fix strlcpy tests

Generally, size_t is an alias for unsigned long long. In the strlcpy
tests, the return value of strlcpy (a size_t) is compared to an unsigned
long. On Linux unsigned long and unsigned long long are both 64 bits,
but on windows unsigned long is 32 bits. Since the macros require
identical types for both sides, this caused a build failure on windows.
This patch changes the constants to be explicit size_t values.

Differential Revision: https://reviews.llvm.org/D125917




More information about the All-commits mailing list