apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Justin Erenkrantz <jerenkra...@ebuilt.com>
Subject Re: Buckets code question
Date Wed, 11 Apr 2001 14:35:51 GMT
On Wed, Apr 11, 2001 at 07:32:10AM -0700, rbb@covalent.net wrote:
> That looks like a bug in the compiler.  That code is definately reachable.

I'd bet that the warning is related to the macro expansion.  

#define apr_bucket_do_create(do_make)     \
    do {             \
   apr_bucket *b, *ap__b;        \
   b = calloc(1, sizeof(*b));    \
   if (b == NULL) {        \
       return NULL;        \
   }              \
   ap__b = do_make;        \
   if (ap__b == NULL) {       \
       free(b);            \
       return NULL;        \
   }              \
   APR_RING_ELEM_INIT(ap__b, link); \
   return ap__b;           \
    } while(0)

I bet VC++ is complaining that the while(0) can't be reached.

If I understand this snippet correctly, why do we even have the do while 
loop in the first place?

My $.02.  -- justin


Mime
View raw message