Skip to content

Commit c606f04

Browse files
committed
utils/info: add some build-time assertions for listing support bits
To make sure we don't forget to update this list. Signed-off-by: Brice Goglin <[email protected]>
1 parent 9969ff0 commit c606f04

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

utils/hwloc/hwloc-info.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#include <fcntl.h>
1616
#include <assert.h>
1717

18+
#include "private/debug.h" /* for HWLOC_BUILD_ASSERT() */
1819
#include "misc.h"
1920
#include "hwloc-calc.h"
2021

@@ -625,6 +626,14 @@ main (int argc, char *argv[])
625626

626627
} else if (mode == HWLOC_INFO_MODE_SUPPORT) {
627628
const struct hwloc_topology_support *support = hwloc_topology_get_support(topology);
629+
630+
#ifdef HWLOC_DEBUG
631+
HWLOC_BUILD_ASSERT(sizeof(struct hwloc_topology_support) == 3*sizeof(void*));
632+
HWLOC_BUILD_ASSERT(sizeof(struct hwloc_topology_discovery_support) == 5);
633+
HWLOC_BUILD_ASSERT(sizeof(struct hwloc_topology_cpubind_support) == 11);
634+
HWLOC_BUILD_ASSERT(sizeof(struct hwloc_topology_membind_support) == 15);
635+
#endif
636+
628637
#define DO(x,y) printf(#x ":" #y " = %u\n", (unsigned char) support->x->y);
629638
DO(discovery, pu);
630639
DO(discovery, disallowed_pu);

0 commit comments

Comments
 (0)