On 11/25/21 17:01, Richard W.M. Jones wrote:
On Thu, Nov 25, 2021 at 04:55:25PM +0100, Laszlo Ersek wrote:
> On 11/25/21 16:30, Richard W.M. Jones wrote:
>> ../../common/include/checked-overflow.h:164:18: error: typedef
'x_has_uint_type' locally defined but not used [-Werror=unused-local-typedefs]
>> typedef char x_has_uint_type[(typeof (x))-1 > 0 ? 1 : -1]; \
>> ^
>> ---
>> common/include/checked-overflow.h | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/common/include/checked-overflow.h
b/common/include/checked-overflow.h
>> index d72f95a2..01943948 100644
>> --- a/common/include/checked-overflow.h
>> +++ b/common/include/checked-overflow.h
>> @@ -161,7 +161,7 @@
>> */
>> #define STATIC_ASSERT_UNSIGNED_INT(x) \
>> do { \
>> - typedef char x_has_uint_type[(typeof (x))-1 > 0 ? 1 : -1]; \
>> + typedef char x_has_uint_type[(typeof (x))-1 > 0 ? 1 : -1]
__attribute__((__unused__)); \
>> } while (0)
>>
>> /* Assign the sum "a + b" to "*r", using uintmax_t modular
arithmetic.
>>
>
> This breaks the nice 80 chars width; can I move
> __attribute__((__unused__)) to the next line? If so, how many space
> chars should I use for indentation, relative to the "typedef"?
Sure; no idea!
Thanks, and interestingly, "prior art" is not consistent:
- In "common/allocators/allocator.h", we have __attribute__ aligned with
the very left of the declaration on the previous line (multiple instances).
- One instance in the same header, and then several in
"common/bitmap/bitmap.h", "common/regions/regions.h",
"common/replacements/syslog.h", indent __attribute__ two spaces relative
to the start of the declaration.
I'll use two spaces for indentation.
(BTW I meant to build this on RHEL7 myself, but then the amount of build
dependencies likely needed discouraged me...)
Thanks!
Laszlo