[PING][PATCH] Fix build warning in pthread_rwlock_*
Roland McGrath
roland@hack.frob.com
Wed Jun 25 00:37:00 GMT 2014
> I ran an automated checker and it holds for nptl code in general. Here
> is patch that fixes obvious parts of what I found.
Maybe you can write something up on the wiki about what methods you used to
check and how people can do that again.
> - if (! dtv[1 + cnt].pointer.is_static
> + if (!dtv[1 + cnt].pointer.is_static
We don't have a clear rule about (! foo) vs (!foo) and I don't find either
one particularly bothersome. So I'm inclined to avoid the churn of changes
just for that. That looks like be a lot of the lines touched here.
> #else
> -#define __set_futex_clock_realtime() do { } while (0)
> +# define __set_futex_clock_realtime() do { } while (0)
> #endif
All these sorts of ones can go under the "obvious enough" rule any time.
I'd say the same for leading spaces->tabs.
> if (!(USE_REQUEUE_PI (cbuffer->mutex))
> || ((cbuffer->mutex->__data.__lock & FUTEX_TID_MASK)
> != THREAD_GETMEM (THREAD_SELF, tid)))
> - {
> - __pthread_mutex_cond_lock (cbuffer->mutex);
> - }
> + {
> + __pthread_mutex_cond_lock (cbuffer->mutex);
> + }
> else
> __pthread_mutex_cond_lock_adjust (cbuffer->mutex);
Here you should just drop the superfluous braces too.
Thanks,
Roland
More information about the Libc-alpha
mailing list