[PATCH] libgomp: Add OMPD process functions and datatypes.

Jakub Jelinek jakub@redhat.com
Tue Jul 7 11:46:40 GMT 2020


On Tue, Jul 07, 2020 at 07:38:13AM -0400, y2s1982 . wrote:
> > I have no idea what this function is doing, but e.g. from aliasing point of
> > view trying to access something as short/int/long long is dangerous, and
> > there might be alignment implications too.
> >
> 
> This function is used in ompd_device_initialize(). The initializing function
> receives a void *id and ompd_size_t sizeof_id. My first attempt tried to
> just
> preserve both information as is, but I wasn't sure how the void * would
> ultimately be read. In the second attempt, I tried to cast the value, based
> on
> the sizeof_id, and store it in a large enough type. This does assume the
> void * is pointing at a numerical value.
> What would be the best way to handle the void *id?

Well, you should know what it is and only depending on that handle it.
If it e.g. would be string, you'd want to use memcpy to copy it somewhere,
or parse immediately, etc.

> > > --- /dev/null
> > > +++ b/libgomp/ompd-types.h
> >
> > ompd-types.h is an installed header I think, so Makefile.am should install
> > it.
> >
> Is this similar to how omp-tools.h was handled before?

Yes.

	Jakub



More information about the Gcc-patches mailing list