From 3b5ecfc5ac16757be76e26ce07a2af926c0aefe6 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Thu, 25 Sep 2025 16:35:32 -0500 Subject: [PATCH] cpukit/posix/*: Address unused parameter warnings Add "(void) param;" annotation to address unused parameter warnings. Found with GCC's warning -Wunused-paramter. --- cpukit/posix/src/alarm.c | 2 ++ cpukit/posix/src/clockgetcpuclockid.c | 3 +++ cpukit/posix/src/condwaitsupp.c | 6 ++++++ cpukit/posix/src/kill_r.c | 2 ++ cpukit/posix/src/pspindestroy.c | 2 ++ cpukit/posix/src/pspininit.c | 4 ++++ cpukit/posix/src/pthreadgetcpuclockid.c | 3 +++ cpukit/posix/src/seminit.c | 2 ++ cpukit/posix/src/shmheap.c | 2 ++ cpukit/posix/src/shmwkspace.c | 2 ++ cpukit/posix/src/wait.c | 2 ++ cpukit/posix/src/waitpid.c | 4 ++++ 12 files changed, 34 insertions(+) diff --git a/cpukit/posix/src/alarm.c b/cpukit/posix/src/alarm.c index 37d09c7ce5..bddd14e92c 100644 --- a/cpukit/posix/src/alarm.c +++ b/cpukit/posix/src/alarm.c @@ -54,6 +54,8 @@ static ISR_lock_Control _POSIX_signals_Alarm_lock = static void _POSIX_signals_Alarm_TSR( Watchdog_Control *the_watchdog ) { + (void) the_watchdog; + int status; status = kill( getpid(), SIGALRM ); diff --git a/cpukit/posix/src/clockgetcpuclockid.c b/cpukit/posix/src/clockgetcpuclockid.c index 4246b7d3d1..221132ec20 100644 --- a/cpukit/posix/src/clockgetcpuclockid.c +++ b/cpukit/posix/src/clockgetcpuclockid.c @@ -55,5 +55,8 @@ int clock_getcpuclockid( clockid_t *clock_id ) { + (void) pid; + (void) clock_id; + rtems_set_errno_and_return_minus_one( ENOSYS ); } diff --git a/cpukit/posix/src/condwaitsupp.c b/cpukit/posix/src/condwaitsupp.c index ba5cc828b6..38c61bc290 100644 --- a/cpukit/posix/src/condwaitsupp.c +++ b/cpukit/posix/src/condwaitsupp.c @@ -51,6 +51,8 @@ static void _POSIX_Condition_variables_Mutex_unlock( Thread_queue_Context *queue_context ) { + (void) queue_context; + POSIX_Condition_variables_Control *the_cond; int mutex_error; @@ -75,6 +77,8 @@ static void _POSIX_Condition_variables_Enqueue_no_timeout( Thread_queue_Context *queue_context ) { + (void) cpu_self; + _POSIX_Condition_variables_Mutex_unlock( queue, the_thread, queue_context ); } @@ -101,6 +105,8 @@ int _POSIX_Condition_variables_Wait_support( clockid_t clock_id ) { + (void) clock_id; + POSIX_Condition_variables_Control *the_cond; unsigned long flags; Thread_queue_Context queue_context; diff --git a/cpukit/posix/src/kill_r.c b/cpukit/posix/src/kill_r.c index 0fafac4749..fd12fc45f0 100644 --- a/cpukit/posix/src/kill_r.c +++ b/cpukit/posix/src/kill_r.c @@ -56,6 +56,8 @@ int _kill_r( int sig ) { + (void) ptr; + return _POSIX_signals_Send( pid, sig, NULL ); } #endif diff --git a/cpukit/posix/src/pspindestroy.c b/cpukit/posix/src/pspindestroy.c index ef93333a1e..7ef6b3dee7 100644 --- a/cpukit/posix/src/pspindestroy.c +++ b/cpukit/posix/src/pspindestroy.c @@ -48,6 +48,8 @@ int pthread_spin_destroy( pthread_spinlock_t *spinlock ) the_spinlock = _POSIX_Spinlock_Get( spinlock ); _SMP_ticket_lock_Destroy( &the_spinlock->Lock ); +#else + (void) spinlock; #endif return 0; } diff --git a/cpukit/posix/src/pspininit.c b/cpukit/posix/src/pspininit.c index 980dc149d3..d7762a23f2 100644 --- a/cpukit/posix/src/pspininit.c +++ b/cpukit/posix/src/pspininit.c @@ -49,11 +49,15 @@ int pthread_spin_init( int pshared ) { + (void) pshared; + #if defined(RTEMS_SMP) POSIX_Spinlock_Control *the_spinlock; the_spinlock = _POSIX_Spinlock_Get( spinlock ); _SMP_ticket_lock_Initialize( &the_spinlock->Lock ); +#else + (void) spinlock; #endif return 0; } diff --git a/cpukit/posix/src/pthreadgetcpuclockid.c b/cpukit/posix/src/pthreadgetcpuclockid.c index a91ce5f17f..0467c41576 100644 --- a/cpukit/posix/src/pthreadgetcpuclockid.c +++ b/cpukit/posix/src/pthreadgetcpuclockid.c @@ -50,5 +50,8 @@ int pthread_getcpuclockid( clockid_t *clock_id ) { + (void) pid; + (void) clock_id; + rtems_set_errno_and_return_minus_one( ENOSYS ); } diff --git a/cpukit/posix/src/seminit.c b/cpukit/posix/src/seminit.c index 0e48553693..2e021f2ecd 100644 --- a/cpukit/posix/src/seminit.c +++ b/cpukit/posix/src/seminit.c @@ -52,6 +52,8 @@ int sem_init( unsigned int value ) { + (void) pshared; + if ( sem == NULL ) { rtems_set_errno_and_return_minus_one( EINVAL ); } diff --git a/cpukit/posix/src/shmheap.c b/cpukit/posix/src/shmheap.c index 9b16210eeb..90a430869b 100644 --- a/cpukit/posix/src/shmheap.c +++ b/cpukit/posix/src/shmheap.c @@ -117,6 +117,8 @@ void * _POSIX_Shm_Object_mmap_from_heap( off_t off ) { + (void) prot; + if ( shm_obj == NULL || shm_obj->handle == NULL ) return 0; diff --git a/cpukit/posix/src/shmwkspace.c b/cpukit/posix/src/shmwkspace.c index 8906e09770..c7ed864d57 100644 --- a/cpukit/posix/src/shmwkspace.c +++ b/cpukit/posix/src/shmwkspace.c @@ -106,6 +106,8 @@ void * _POSIX_Shm_Object_mmap_from_workspace( off_t off ) { + (void) prot; + if ( shm_obj == NULL || shm_obj->handle == NULL ) return 0; diff --git a/cpukit/posix/src/wait.c b/cpukit/posix/src/wait.c index c7f8d6547c..de99aa5d48 100644 --- a/cpukit/posix/src/wait.c +++ b/cpukit/posix/src/wait.c @@ -47,5 +47,7 @@ int wait( int *stat_loc ) { + (void) stat_loc; + rtems_set_errno_and_return_minus_one( ENOSYS ); } diff --git a/cpukit/posix/src/waitpid.c b/cpukit/posix/src/waitpid.c index bdde592d95..1ffd2de5e4 100644 --- a/cpukit/posix/src/waitpid.c +++ b/cpukit/posix/src/waitpid.c @@ -48,5 +48,9 @@ int waitpid( int options ) { + (void) pid; + (void) stat_loc; + (void) options; + rtems_set_errno_and_return_minus_one( ENOSYS ); }