Richard W.M. Jones
2021-Nov-25 15:30 UTC
[Libguestfs] [PATCH nbdkit v2 follow-up 2/4] Add __attribute__((__unused__))
../../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. -- 2.32.0
Laszlo Ersek
2021-Nov-25 15:55 UTC
[Libguestfs] [PATCH nbdkit v2 follow-up 2/4] Add __attribute__((__unused__))
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"? Thanks! Laszlo