Let's use G_STATIC_ASSERT() instead of creating a dummy array to check
the size of the _PrimaryVolumeDescriptor struct.

Signed-off-by: Fabiano Fidêncio <[email protected]>
---
 osinfo/osinfo_media.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/osinfo/osinfo_media.c b/osinfo/osinfo_media.c
index 1ee1fa5..cf1cf91 100644
--- a/osinfo/osinfo_media.c
+++ b/osinfo/osinfo_media.c
@@ -59,10 +59,9 @@ struct _PrimaryVolumeDescriptor {
 
 /* the PrimaryVolumeDescriptor struct must exactly 2048 bytes long
  * since we expect the supplementary volume descriptor to be right
- * after it. The magic declaration below ensures we get a compilatin
- * error if its size is not correct
+ * after it.
  */
-char dummy[sizeof(struct _PrimaryVolumeDescriptor) == 2048 ? 1 : -1];
+G_STATIC_ASSERT(sizeof(struct _PrimaryVolumeDescriptor) == 2048);
 
 typedef struct _SupplementaryVolumeDescriptor SupplementaryVolumeDescriptor;
 
-- 
2.19.1

_______________________________________________
Libosinfo mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/libosinfo

Reply via email to