[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] Correctly handle pointer alignment with typedef'd types
From: |
Andrej Shadura |
Subject: |
Re: [PATCH] Correctly handle pointer alignment with typedef'd types |
Date: |
Thu, 11 Apr 2019 19:54:55 +0200 |
Hi,
On Thu, 11 Apr 2019 at 19:30, Nikhil Benesch <address@hidden> wrote:
> This fixes a as-of-yet unreported bug, in which indent misaligns pointers
> in function parameters when the parameters use a typedef type. For example,
>
> func f1(int *void)
>
> renders correctly, but
>
> func f1(uint64_t *void)
>
> misrenders as:
>
> func f1(uint64_t * void)
>
> The problem occurs because the parser thinks `uint64_t* void` is a binary
> multiplication operation, while `int *void` involves a unary dereference
> operator. The pointer alignment code only adjust the spacing of unary
> operators, at present.
>
> The attached patch fixes the issue by looking for multiplications inside
> function parameters and spacing them properly. With the patch, the entire
> regression test suite passes on my machine, including the additional test
> coverage for the bug.
Thanks, I’ll have a look at this some time next week (I’m currently
busy with lots of other stuff).
> P.S. Is there a better place to send this mail? I didn't see any mailing
> lists besides this one, and the patches section of the Savannah project
> doesn't seem to be used.
This mailing list is fine.
--
Cheers,
Andrej