From a8f1185a7fdee4183a544370dfbb485b31d4077a Mon Sep 17 00:00:00 2001 From: Jie Fu Date: Tue, 4 Apr 2023 22:50:55 +0800 Subject: [PATCH] [flang] Fix -Wsign-compare in check-call.cpp (NFC) /data/llvm-project/flang/lib/Semantics/check-call.cpp:1234:29: error: comparison of integers of different signs: 'int' and 'size_type' (aka 'unsigned long') [-Werror,-Wsign-compare] CHECK(index >= 0 && index < actuals.size()); ~~~~~ ^ ~~~~~~~~~~~~~~ /data/llvm-project/flang/include/flang/Common/idioms.h:89:20: note: expanded from macro 'CHECK' ^ 1 error generated. --- flang/lib/Semantics/check-call.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flang/lib/Semantics/check-call.cpp b/flang/lib/Semantics/check-call.cpp index 3a31dba..4d2a118 100644 --- a/flang/lib/Semantics/check-call.cpp +++ b/flang/lib/Semantics/check-call.cpp @@ -1231,7 +1231,7 @@ bool CheckInterfaceForGeneric(const characteristics::Procedure &proc, bool CheckArgumentIsConstantExprInRange( const evaluate::ActualArguments &actuals, int index, int lowerBound, int upperBound, parser::ContextualMessages &messages) { - CHECK(index >= 0 && index < actuals.size()); + CHECK(index >= 0 && static_cast(index) < actuals.size()); const std::optional &argOptional{actuals[index]}; if (!argOptional) { -- 2.7.4