From 7b714286cfd65e797364fbdc583e13adba71a2ee Mon Sep 17 00:00:00 2001 From: rpj Date: Wed, 24 Oct 2001 05:28:42 +0000 Subject: * attr.c (pthread_attr_setstacksize): Quell warning from LCC by conditionally compiling the stacksize validity check. LCC correctly warns that the condition (stacksize < PTHREAD_STACK_MIN) is suspicious because STACK_MIN is 0 and stacksize is of type size_t (or unsigned int). --- ChangeLog | 9 +++++++++ attr.c | 4 ++++ 2 files changed, 13 insertions(+) diff --git a/ChangeLog b/ChangeLog index f9762d7..c4c90fd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2001-10-24 Ross Johnson + + * attr.c (pthread_attr_setstacksize): Quell warning + from LCC by conditionally compiling the stacksize + validity check. LCC correctly warns that the condition + (stacksize < PTHREAD_STACK_MIN) is suspicious + because STACK_MIN is 0 and stacksize is of type + size_t (or unsigned int). + 2001-10-15 Ross Johnson * spin.c (pthread_spin_lock): PTHREAD_SPINLOCK_INITIALIZER diff --git a/attr.c b/attr.c index 74c2a59..c099ad9 100644 --- a/attr.c +++ b/attr.c @@ -87,12 +87,16 @@ pthread_attr_setstacksize(pthread_attr_t *attr, { #ifdef _POSIX_THREAD_ATTR_STACKSIZE +#if PTHREAD_STACK_MIN > 0 + /* Verify that the stack size is within range. */ if (stacksize < PTHREAD_STACK_MIN) { return EINVAL; } +#endif + if (is_attr(attr) != 0) { return EINVAL; -- cgit v1.2.3