Hello Pavan,
Are you sure you're not passing -Wstack-usage? My Ubuntu 18.04 with
latest gcc-7 (7.3.0-27ubuntu1~18.04) doesn't show any of those warnings.
It looks like all these warnings are caused by C99 variable-length
arrays (except 2 that I don't understand). I know the kernel devs
stopped using VLA recently, and it looks like C11 made them optional.
But are we really supposed to stop using VLA already?
Brice
Le 25/02/2019 à 02:07, Balaji, Pavan via hwloc-users a écrit :
> Folks,
>
> I'm getting the below build warnings with hwloc-2.0.3, gcc-7.3 on Ubuntu
> (with -Wall -O2):
>
> 8<
> ../../../../../../../../../mpich/src/pm/hydra/tools/topo/hwloc/hwloc/hwloc/distances.c:
> In function 'hwloc__groups_by_distances':
> ../../../../../../../../../mpich/src/pm/hydra/tools/topo/hwloc/hwloc/hwloc/distances.c:817:1:
> warning: stack usage might be unbounded [-Wstack-usage=]
> hwloc__groups_by_distances(struct hwloc_topology *topology,
> ^~
> ../../../../../../../../../mpich/src/pm/hydra/tools/topo/hwloc/hwloc/hwloc/topology.c:
> In function 'hwloc_propagate_symmetric_subtree':
> ../../../../../../../../../mpich/src/pm/hydra/tools/topo/hwloc/hwloc/hwloc/topology.c:2388:1:
> warning: stack usage might be unbounded [-Wstack-usage=]
> hwloc_propagate_symmetric_subtree(hwloc_topology_t topology, hwloc_obj_t
> root)
> ^
> ../../../../../../../../../mpich/src/pm/hydra/tools/topo/hwloc/hwloc/hwloc/topology-synthetic.c:
> In function 'hwloc_synthetic_process_indexes':
> ../../../../../../../../../mpich/src/pm/hydra/tools/topo/hwloc/hwloc/hwloc/topology-synthetic.c:71:1:
> warning: stack usage might be unbounded [-Wstack-usage=]
> hwloc_synthetic_process_indexes(struct hwloc_synthetic_backend_data_s *data,
> ^~~
> ../../../../../../../../../mpich/src/pm/hydra/tools/topo/hwloc/hwloc/hwloc/topology-xml.c:
> In function 'hwloc__xml_export_object_contents':
> ../../../../../../../../../mpich/src/pm/hydra/tools/topo/hwloc/hwloc/hwloc/topology-xml.c:1920:1:
> warning: stack usage might be unbounded [-Wstack-usage=]
> hwloc__xml_export_object_contents (hwloc__xml_export_state_t state,
> hwloc_topology_t topology, hwloc_obj_t obj, unsigned long flags)
> ^
> ../../../../../../../../../mpich/src/pm/hydra/tools/topo/hwloc/hwloc/hwloc/topology-linux.c:
> In function 'hwloc_linux_get_area_membind':
> ../../../../../../../../../mpich/src/pm/hydra/tools/topo/hwloc/hwloc/hwloc/topology-linux.c:1883:1:
> warning: stack usage might be unbounded [-Wstack-usage=]
> hwloc_linux_get_area_membind(hwloc_topology_t topology, const void *addr,
> size_t len, hwloc_nodeset_t nodeset, hwloc_membind_policy_t *policy, int
> flags __hwloc_attribute_unused)
> ^~~~
> ../../../../../../../../../mpich/src/pm/hydra/tools/topo/hwloc/hwloc/hwloc/topology-linux.c:
> In function 'hwloc_linux_set_thisthread_membind':
> ../../../../../../../../../mpich/src/pm/hydra/tools/topo/hwloc/hwloc/hwloc/topology-linux.c:1737:1:
> warning: stack usage might be unbounded [-Wstack-usage=]
> hwloc_linux_set_thisthread_membind(hwloc_topology_t topology,
> hwloc_const_nodeset_t nodeset, hwloc_membind_policy_t policy, int flags)
> ^~
> ../../../../../../../../../mpich/src/pm/hydra/tools/topo/hwloc/hwloc/hwloc/topology-linux.c:
> In function 'hwloc_linux_get_thisthread_membind':
> ../../../../../../../../../mpich/src/pm/hydra/tools/topo/hwloc/hwloc/hwloc/topology-linux.c:1848:1:
> warning: stack usage might be unbounded [-Wstack-usage=]
> hwloc_linux_get_thisthread_membind(hwloc_topology_t topology,
> hwloc_nodeset_t nodeset, hwloc_membind_policy_t *policy, int flags
> __hwloc_attribute_unused)
> ^~
> ../../../../../../../../../mpich/src/pm/hydra/tools/topo/hwloc/hwloc/hwloc/topology-linux.c:
> In function 'hwloc_linux__get_allowed_resources':
> ../../../../../../../../../mpich/src/pm/hydra/tools/topo/hwloc/hwloc/hwloc/topology-linux.c:4426:13:
> warning: stack usage might be unbounded [-Wstack-usage=]
> static void hwloc_linux__get_allowed_resources(hwloc_topology_t topology,
> const char *root_path, int root_fd, char **cpuset_namep)
> ^~
> ../../../../../../../../../mpich/src/pm/hydra/tools/topo/hwloc/hwloc/hwloc/topology-x86.c:
> In function 'cpuiddump_read':
> ../../../../../../../../../mpich/src/pm/hydra/tools/topo/hwloc/hwloc/hwloc/topology-x86.c:69:1:
> warning: stack usage might be unbounded [-Wstack-usage=]
> cpuiddump_read(const char *dirpath, unsigned idx)
> ^~
> ../../../../../../../../../mpich/src/pm/hydra/tools/topo/hwloc/hwloc/hwloc/topology-x86.c:
> In function 'hwloc_x86_component_instantiate':
> ../../../../../../../../../mpich/src/pm/hydra/tools/topo/hwloc/hwloc/hwloc/topology-x86.c:1456:1:
> warning: stack usage might be unbounded