Open MPI logo

Hardware Locality Development Mailing List Archives

  |   Home   |   Support   |   FAQ   |   all Hardware Locality Development mailing list

Subject: [hwloc-devel] excessive warnings from xlc w/ hwloc-trunk
From: Paul H. Hargrove (PHHargrove_at_[hidden])
Date: 2012-02-17 18:57:57

The patch below is required to avoid xlc-11.1 on Linux/ppc64 from
issuing lots of warnings:

"[srcdir]/hwloc-trunk/include/hwloc.h", line 1245.34: 1506-1385 (W) The
attribute "pure" is not a valid type attribute.

The problem appears to be that when the function returns a pointer type,
XLC thinks the attribute is being applied to the return type rather than
the function. That is why no other instances of __hwloc_attribute_pure
need to be reordered.

I am not sure of the risk/reward on applying this change, however.
Gcc seems to be happy enough either way as far as I could tell.


--- hwloc-1.5a1r4308/include/hwloc.h~ 2012-02-17 17:45:45.000000000 -0600
+++ hwloc-1.5a1r4308/include/hwloc.h 2012-02-17 17:52:20.000000000 -0600
@@ -1242,7 +1242,7 @@
   * \return \c NULL if no such key exists.
-static __hwloc_inline const char * __hwloc_attribute_pure
+static __hwloc_inline __hwloc_attribute_pure const char *
  hwloc_obj_get_info_by_name(hwloc_obj_t obj, const char *name)
    unsigned i;

Paul H. Hargrove                          PHHargrove_at_[hidden]
Future Technologies Group
HPC Research Department                   Tel: +1-510-495-2352
Lawrence Berkeley National Laboratory     Fax: +1-510-486-6900