From e4a63b12d537a32ae6e838d38946c96a74c08e16 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Thu, 6 Nov 2025 10:28:12 -0600 Subject: [PATCH] testsuites/psxtests: Correct comparisons of different signedness The GCC warning -Wsign-compare flagged these instances of comparing signed and unsigned types. A common pair was size_t and int. --- testsuites/psxtests/psxfile01/test_cat.c | 10 +++++----- testsuites/psxtests/psxmsgq03/init.c | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/testsuites/psxtests/psxfile01/test_cat.c b/testsuites/psxtests/psxfile01/test_cat.c index c2b3c4bb25..f461d21358 100644 --- a/testsuites/psxtests/psxfile01/test_cat.c +++ b/testsuites/psxtests/psxfile01/test_cat.c @@ -50,7 +50,7 @@ #include /* forward declarations to avoid warnings */ -void test_cat(char *file, int offset_arg, int length); +void test_cat(char *file, int offset_arg, size_t length); /* * test_cat routine @@ -59,15 +59,15 @@ void test_cat(char *file, int offset_arg, int length); unsigned char test_cat_buffer[ 1024 ]; void test_cat( - char *file, - int offset_arg, - int length + char *file, + int offset_arg, + size_t length ) { int fd; int status; int is_printable = 0; - int my_length; + size_t my_length; int i; unsigned char c; int count = 0; diff --git a/testsuites/psxtests/psxmsgq03/init.c b/testsuites/psxtests/psxmsgq03/init.c index f79d4eb604..28fadf731b 100644 --- a/testsuites/psxtests/psxmsgq03/init.c +++ b/testsuites/psxtests/psxmsgq03/init.c @@ -83,10 +83,10 @@ void *POSIX_Init( puts( "Init - Open message queue" ); Queue = mq_open( "Qsend", O_CREAT | O_RDWR, 0x777, &attr ); - if ( Queue == (-1) ) { + if ( Queue == (mqd_t)(-1) ) { perror( "mq_open failed" ); } - rtems_test_assert( Queue != (-1) ); + rtems_test_assert( Queue != (mqd_t)(-1) ); puts( "Init - send to message queue" ); status = mq_send( Queue, (const char *)&status, sizeof(int), 1 );