Skip to content

Commit acfdecb

Browse files
committed
perf: Fix libjvmti.c sign compare error
JIRA: https://issues.redhat.com/browse/RHEL-78200 upstream ======== commit 1190410 Author: Yuzhuo Jing <yuzhuo@google.com> Date: Wed Jun 4 10:36:32 2025 -0700 description =========== Fix the compile errors when compiling with -Werror=sign-compare. This is a follow-up patch to a previous patch series for a separate issue. Link: https://lore.kernel.org/lkml/aC9lXhPFcs5fkHWH@x1/ Signed-off-by: Yuzhuo Jing <yuzhuo@google.com> Reviewed-by: Ian Rogers <irogers@google.com> Link: https://lore.kernel.org/r/20250604173632.2362759-1-yuzhuo@google.com Signed-off-by: Namhyung Kim <namhyung@kernel.org> Signed-off-by: Anubhav Shelat <ashelat@redhat.com>
1 parent 0baa0eb commit acfdecb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tools/perf/jvmti/libjvmti.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,11 +141,11 @@ copy_class_filename(const char * class_sign, const char * file_name, char * resu
141141
* Assume path name is class hierarchy, this is a common practice with Java programs
142142
*/
143143
if (*class_sign == 'L') {
144-
int j, i = 0;
144+
size_t j, i = 0;
145145
char *p = strrchr(class_sign, '/');
146146
if (p) {
147147
/* drop the 'L' prefix and copy up to the final '/' */
148-
for (i = 0; i < (p - class_sign); i++)
148+
for (i = 0; i < (size_t)(p - class_sign); i++)
149149
result[i] = class_sign[i+1];
150150
}
151151
/*

0 commit comments

Comments
 (0)