cvs commit: src/lib/libc/gen closedir.c
Bruce Evans
brde at optusnet.com.au
Mon Dec 3 17:01:11 PST 2007
On Mon, 3 Dec 2007, [utf-8] Dag-Erling Smørgrav wrote:
> Olivier Houchard <cognet at FreeBSD.org> writes:
>> Log:
>> Change the casts from (pthread_mutex_t *) to (void *) to keep gcc quiet.
>> Anybody with a cleaner solution feel free to change it.
>
> Declare dd_lock as a struct pthread_mutex * instead of a void * in
> src/include/dirent.h.
dd_lock cannot be declared as struct pthread_mutex *, since pthread_mutex
is not permitted in the application namespace of dirent.h. dirent.h
is (was) careful about namespaces. E.g., it keeps out of the application
namespace for its own struct _dirdesc. This doesn't work for pthread_mutex
since that is misdesigned. (I think pthread_mutex_t is supposed to
hide the implementation and reduce namespace problems, but struct
pthread was only declared in <pthread.h> where it is permitted in the
namespace, so <pthread.h> doesn't bother naming it struct _pthread_mutex.
Other headers can't define it with a different name (tag) because different
tags give different structs.)
Bruce
More information about the cvs-src
mailing list