[all-commits] [llvm/llvm-project] 2aebb7: [OpenMP] Fix incorrect KMP_STRLEN() macro

Jonathan Peyton via All-commits all-commits at lists.llvm.org
Mon Apr 5 07:04:00 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 2aebb7cb3c88b1446515563653c821e8165b3aaf
      https://github.com/llvm/llvm-project/commit/2aebb7cb3c88b1446515563653c821e8165b3aaf
  Author: Peyton, Jonathan L <jonathan.l.peyton at intel.com>
  Date:   2021-04-05 (Mon, 05 Apr 2021)

  Changed paths:
    M openmp/runtime/src/kmp_os.h
    M openmp/runtime/src/kmp_safe_c_api.h

  Log Message:
  -----------
  [OpenMP] Fix incorrect KMP_STRLEN() macro

The second argument to the strnlen_s(str, size) function should be
sizeof(str) when str is a true array of characters with known size
(instead of just a char*). Use type traits to determine if first
parameter is a character array and use the correct size based on that
trait.

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




More information about the All-commits mailing list