|
From: Tom H. <th...@cy...> - 2004-06-14 12:11:14
|
In message <Pin...@or...>
Nicholas Nethercote <nj...@ca...> wrote:
> 2a. Doing 'make regtest' I get this warning:
>
> pth_cancel1.c: In function `thread_main':
> pth_cancel1.c:16: warning: declaration of `_buffer' shadows a previous local
> pth_cancel1.c:15: warning: shadowed declaration is here
>
> Looking in pthread.h, there are these macros:
>
> #define pthread_cleanup_push(routine,arg) \
> { struct _pthread_cleanup_buffer _buffer; \
> _pthread_cleanup_push (&_buffer, (routine), (arg));
>
> #define pthread_cleanup_pop(execute) \
> _pthread_cleanup_pop (&_buffer, (execute)); }
>
> which are totally weird -- note the unmatched curly braces! Do others see
> this warning? The test itself passes.
The whole point is that you have to use those routines as a matching
pair so the scope is opened in one and closed in the other. That is
an NPTL style pthread.h that uses the new cleanup interface.
The warning is strictly correct because that test deliberately pushes
two handlers to make sure they execute in the correct order when the
thread is cancelled. The pthread.h header should probably do some
horrible tricks with __LINE__ to generate unique variable names...
> 2b. none/tests/sem.c doesn't compile for me:
>
> sem.o(.text+0xcb): In function `main':
> /homes/njn25/grind/head8/none/tests/sem.c:39: undefined reference to `semtimedop'
> sem.o(.text+0x190):/homes/njn25/grind/head8/none/tests/sem.c:64: undefined reference to `semtimedop'
> collect2: ld returned 1 exit status
I found this on my older systems as well. It looks like semtimedop is
new so older systems don't have it. I'll have a play with configure to
solve it.
Tom
--
Tom Hughes (th...@cy...)
Software Engineer, Cyberscience Corporation
http://www.cyberscience.com/
|