Le 10/10/2019 à 17:38, Gutierrez, Samuel K. via hwloc-users a écrit :
> Good morning,
>
> I have a question about expected name mangling behavior when using 
> HWLOC_SET_SYMBOL_PREFIX in hwloc v2.1.0 (and perhaps other versions).
>
> Say, for example, I do the following in a project embedding hwloc:
>
> HWLOC_SET_SYMBOL_PREFIX(foo_internal_)
> HWLOC_SETUP_CORE(…)
> ...
>
> Now, entry points into hwloc are prefixed with foo_internal_ (e.g., 
> foo_internal_hwloc_topology_init()). This all works great.
>
> Next, let’s consider what happens to hwloc-exported constants such as 
> HWLOC_OBJ_MACHINE when using the same setup above. I would expect something 
> like this: 
> HWLOC_OBJ_MACHINE now becomes FOO_INTERNAL_HWLOC_OBJ_MACHINE. Instead, I 
> notice the following curious mangling convention:  
> FOO_INTERNAL_hwloc_OBJ_MACHINE. Is this intentional? If so, that’s 
> fine—functionally, it works as expected. However, this seems like a bug.


Hello

#define HWLOC_NAME(name) HWLOC_MUNGE_NAME(HWLOC_SYM_PREFIX, hwloc_ ## name)
#define HWLOC_NAME_CAPS(name) HWLOC_MUNGE_NAME(HWLOC_SYM_PREFIX_CAPS,
hwloc_ ## name)

Indeed I don't see any reason not to use HWLOC_ on the second line. It
looks like we've been doing this forever.

Even if users are supposed to only use official (non-renamed) names, I
guess there might exist a ugly hack that explicitly depends on renamed
names somewhere in hwloc users' code. So I'd rather not touch this as
long as it doesn't break anything.

Brice


_______________________________________________
hwloc-users mailing list
hwloc-users@lists.open-mpi.org
https://lists.open-mpi.org/mailman/listinfo/hwloc-users

Reply via email to