bug-indent
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: bug formatting a .h function extern declaration with attribute macro


From: Simon Josefsson
Subject: Re: bug formatting a .h function extern declaration with attribute macros
Date: Fri, 04 Apr 2025 14:16:03 +0200
User-agent: Gnus/5.13 (Gnus v5.13)

Eric Blake <eblake@redhat.com> writes:

>> #  define G_GNUC_IDN2_ATTRIBUTE_PURE __attribute__ ((pure))
...
>>   extern _IDN2_API const char *idn2_check_version (const char *req_version)
>>     G_GNUC_IDN2_ATTRIBUTE_PURE;
>
> Figuring out how to write the __attribute__-hiding macros conditional
> on compiler version wasn't the issue (the m4 definitions for
> ATTRIBUTE_PURE come from gnulib, and are under a similar ladder of
> #if); rather, it's that an all-caps macro that takes no arguments and
> appears after the func(params) but before the trailing ; of an extern
> function declaration confuse indent.

By formatting things like the above, without any '(())', then indent is
happy.  I run indent on the idn2.h and it looks like the above without
any INDENT-OFF.  If I included the '(())' part, then just like you I had
issues getting indent to behave.  The conditional part is unrelated to
the indent issue, but I can see that my recommendation was unclear.

/Simon

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]