[all-commits] [llvm/llvm-project] fad2ad: [libc][fcntl] fix -Wshorten-64-to-32 for 32b ARM (...

Nick Desaulniers (paternity leave) via All-commits all-commits at lists.llvm.org
Tue Jun 18 14:11:12 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: fad2ad704983ecf975f437f2352b3e72ec8d23a0
      https://github.com/llvm/llvm-project/commit/fad2ad704983ecf975f437f2352b3e72ec8d23a0
  Author: Nick Desaulniers (paternity leave) <nickdesaulniers at users.noreply.github.com>
  Date:   2024-06-18 (Tue, 18 Jun 2024)

  Changed paths:
    M libc/src/__support/OSUtil/linux/fcntl.cpp

  Log Message:
  -----------
  [libc][fcntl] fix -Wshorten-64-to-32 for 32b ARM (#95945)

Fixes:

    llvm-project/libc/src/__support/OSUtil/linux/fcntl.cpp:63:26: error:
implicit conversion loses integer precision: '__off64_t' (aka 'long
long')
    to '__off_t' (aka 'long') [-Werror,-Wshorten-64-to-32]
        flk->l_start = flk64.l_start;
                     ~ ~~~~~~^~~~~~~
    llvm-project/libc/src/__support/OSUtil/linux/fcntl.cpp:64:24: error:
implicit conversion loses integer precision: '__off64_t' (aka 'long
long')
    to '__off_t' (aka 'long') [-Werror,-Wshorten-64-to-32]
        flk->l_len = flk64.l_len;
                   ~ ~~~~~~^~~~~

We already have an overflow check, just need the cast to be explicit.
This
warning was observed on the 32b ARM build in overlay mode.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list