This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PING][PATCH] Fix build warning in pthread_rwlock_*
- From: Roland McGrath <roland at hack dot frob dot com>
- To: OndÅej BÃlka <neleai at seznam dot cz>
- Cc: Siddhesh Poyarekar <siddhesh at redhat dot com>, libc-alpha at sourceware dot org
- Date: Tue, 24 Jun 2014 17:37:29 -0700 (PDT)
- Subject: Re: [PING][PATCH] Fix build warning in pthread_rwlock_*
- Authentication-results: sourceware.org; auth=none
- References: <20140619165137 dot GR7238 at spoyarek dot pnq dot redhat dot com> <20140624090347 dot GH4477 at spoyarek dot pnq dot redhat dot com> <20140624201827 dot 366672C39D2 at topped-with-meat dot com> <20140624235912 dot GA18836 at domone dot podge>
> 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