Re: [PATCH 1/2] add macro REALLOCARRAY
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Sep 16, 2014, 03:04 UTC
- Message-ID
- <CAPc5daXuYVXG=b3Mjn=8oE71FqE_PRZ=XHXW_0F5uHawWwy4HQ@mail.gmail.com>
- In-Reply-To
- <5415C89C.4090509@web.de>
On Sun, Sep 14, 2014 at 9:55 AM, René Scharfe <l.s.r@web.de> wrote:
> +#define REALLOCARRAY(x, alloc) x = xrealloc((x), (alloc) * sizeof(*(x)))
I have been wondering if "x" could be an expression that has an operator that binds weaker than the assignment '='. That may necessitate the LHS of the assignment to be somehow marked as bound the tightest, i.e.
#define REALLOC_ARRAY(x, alloc) (x) = xrealloc((x), (alloc) * sizeof(*(x)))
Or am I being overly silly?