[all-commits] [llvm/llvm-project] 998f3e: [mlir] Fix -Wcast-qual in mlir/test/CAPI/ir.c afte...

Jie Fu via All-commits all-commits at lists.llvm.org
Tue Jul 18 20:18:18 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 998f3e71c8e98cd6c3d6110fb7ca6e1700592e75
      https://github.com/llvm/llvm-project/commit/998f3e71c8e98cd6c3d6110fb7ca6e1700592e75
  Author: Jie Fu <jiefu at tencent.com>
  Date:   2023-07-19 (Wed, 19 Jul 2023)

  Changed paths:
    M mlir/test/CAPI/ir.c

  Log Message:
  -----------
  [mlir] Fix -Wcast-qual in mlir/test/CAPI/ir.c after D153911 (NFC)

/Users/jiefu/llvm-project/mlir/test/CAPI/ir.c:1120:18: error: cast from 'const void *' to 'unsigned char *' drops const qualifier [-Werror,-Wcast-qual]
      (uint8_t *)mlirDenseElementsAttrGetRawData(uint8Elements);
                 ^
/Users/jiefu/llvm-project/mlir/test/CAPI/ir.c:1121:35: error: cast from 'const void *' to 'signed char *' drops const qualifier [-Werror,-Wcast-qual]
  int8_t *int8RawData = (int8_t *)mlirDenseElementsAttrGetRawData(int8Elements);
                                  ^
/Users/jiefu/llvm-project/mlir/test/CAPI/ir.c:1123:19: error: cast from 'const void *' to 'unsigned int *' drops const qualifier [-Werror,-Wcast-qual]
      (uint32_t *)mlirDenseElementsAttrGetRawData(uint32Elements);
                  ^
/Users/jiefu/llvm-project/mlir/test/CAPI/ir.c:1125:18: error: cast from 'const void *' to 'int *' drops const qualifier [-Werror,-Wcast-qual]
      (int32_t *)mlirDenseElementsAttrGetRawData(int32Elements);
                 ^
/Users/jiefu/llvm-project/mlir/test/CAPI/ir.c:1127:19: error: cast from 'const void *' to 'unsigned long long *' drops const qualifier [-Werror,-Wcast-qual]
      (uint64_t *)mlirDenseElementsAttrGetRawData(uint64Elements);
                  ^
/Users/jiefu/llvm-project/mlir/test/CAPI/ir.c:1129:18: error: cast from 'const void *' to 'long long *' drops const qualifier [-Werror,-Wcast-qual]
      (int64_t *)mlirDenseElementsAttrGetRawData(int64Elements);
                 ^
/Users/jiefu/llvm-project/mlir/test/CAPI/ir.c:1130:34: error: cast from 'const void *' to 'float *' drops const qualifier [-Werror,-Wcast-qual]
  float *floatRawData = (float *)mlirDenseElementsAttrGetRawData(floatElements);
                                 ^
/Users/jiefu/llvm-project/mlir/test/CAPI/ir.c:1132:17: error: cast from 'const void *' to 'double *' drops const qualifier [-Werror,-Wcast-qual]
      (double *)mlirDenseElementsAttrGetRawData(doubleElements);
                ^
/Users/jiefu/llvm-project/mlir/test/CAPI/ir.c:1134:19: error: cast from 'const void *' to 'unsigned short *' drops const qualifier [-Werror,-Wcast-qual]
      (uint16_t *)mlirDenseElementsAttrGetRawData(bf16Elements);
                  ^
/Users/jiefu/llvm-project/mlir/test/CAPI/ir.c:1136:19: error: cast from 'const void *' to 'unsigned short *' drops const qualifier [-Werror,-Wcast-qual]
      (uint16_t *)mlirDenseElementsAttrGetRawData(f16Elements);
                  ^
10 errors generated.




More information about the All-commits mailing list