[llvm-branch-commits] [mlir] 0fd0f88 - [mlir] Use long rather than int to address pointer-to-int narrowing warning

David Blaikie via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Thu Dec 3 13:15:19 PST 2020


Author: David Blaikie
Date: 2020-12-03T13:09:36-08:00
New Revision: 0fd0f885eb990feecd67749eff79a5a821767d84

URL: https://github.com/llvm/llvm-project/commit/0fd0f885eb990feecd67749eff79a5a821767d84
DIFF: https://github.com/llvm/llvm-project/commit/0fd0f885eb990feecd67749eff79a5a821767d84.diff

LOG: [mlir] Use long rather than int to address pointer-to-int narrowing warning

Added: 
    

Modified: 
    mlir/test/CAPI/ir.c

Removed: 
    


################################################################################
diff  --git a/mlir/test/CAPI/ir.c b/mlir/test/CAPI/ir.c
index afada8ade70d..396984690e02 100644
--- a/mlir/test/CAPI/ir.c
+++ b/mlir/test/CAPI/ir.c
@@ -1280,19 +1280,19 @@ int registerOnlyStd() {
 
 // Wraps a diagnostic into additional text we can match against.
 MlirLogicalResult errorHandler(MlirDiagnostic diagnostic, void *userData) {
-  fprintf(stderr, "processing diagnostic (userData: %d) <<\n", (int)userData);
+  fprintf(stderr, "processing diagnostic (userData: %ld) <<\n", (long)userData);
   mlirDiagnosticPrint(diagnostic, printToStderr, NULL);
   fprintf(stderr, "\n");
   MlirLocation loc = mlirDiagnosticGetLocation(diagnostic);
   mlirLocationPrint(loc, printToStderr, NULL);
   assert(mlirDiagnosticGetNumNotes(diagnostic) == 0);
-  fprintf(stderr, ">> end of diagnostic (userData: %d)\n", (int)userData);
+  fprintf(stderr, ">> end of diagnostic (userData: %ld)\n", (long)userData);
   return mlirLogicalResultSuccess();
 }
 
 // Logs when the delete user data callback is called
 static void deleteUserData(void *userData) {
-  fprintf(stderr, "deleting user data (userData: %d)\n", (int)userData);
+  fprintf(stderr, "deleting user data (userData: %ld)\n", (long)userData);
 }
 
 void testDiagnostics() {


        


More information about the llvm-branch-commits mailing list