From 21f65f8e79b25b8367fc8d177b5f156b3575c89e Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Wed, 28 Apr 2021 16:41:51 +0000 Subject: [PATCH] 8266206: Build failure after JDK-8264752 with older GCCs Reviewed-by: mgronlun --- src/hotspot/share/jfr/recorder/service/jfrOptionSet.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/hotspot/share/jfr/recorder/service/jfrOptionSet.cpp b/src/hotspot/share/jfr/recorder/service/jfrOptionSet.cpp index 0ff30d816b8..2e65a7e6867 100644 --- a/src/hotspot/share/jfr/recorder/service/jfrOptionSet.cpp +++ b/src/hotspot/share/jfr/recorder/service/jfrOptionSet.cpp @@ -395,8 +395,9 @@ static julong divide_with_user_unit(Argument& memory_argument, julong value) { static const char higher_than_msg[] = "This value is higher than the maximum size limited "; static const char lower_than_msg[] = "This value is lower than the minimum size required "; -template +template static void log_out_of_range_value(Argument& memory_argument, julong min_value) { + const char* msg = lower ? lower_than_msg : higher_than_msg; if (memory_argument.value()._size != memory_argument.value()._val) { // has multiplier log_error(arguments) ( @@ -619,7 +620,7 @@ template static bool ensure_gteq(Argument& memory_argument, const jlong value) { if ((jlong)memory_argument.value()._size < value) { log_set_value(memory_argument); - log_out_of_range_value(memory_argument, value); + log_out_of_range_value(memory_argument, value); return false; } return true; @@ -654,7 +655,7 @@ template static bool ensure_lteq(Argument& memory_argument, const jlong value) { if ((jlong)memory_argument.value()._size > value) { log_set_value(memory_argument); - log_out_of_range_value(memory_argument, value); + log_out_of_range_value(memory_argument, value); return false; } return true;