Skip to content

[compiler-rt][XRay] xray_interface.h not C compliant #139902

@Thyre

Description

@Thyre

Heya 👋

We're currently looking into integrating a prototype developed by @sebastiankreutzer and @pauladelmann, which enables the usage of XRay for compiler instrumentation in the performance measurement infrastructure Score-P. The prototype so far uses C++, but we are looking to port it to C, as this prevents some issues we might run into down the line. A lot of work in that direction is already done, but we noticed an issue with xray_interface.h.

xray_interface.h includes two headers:

#include <cstddef>
#include <cstdint>

Both headers are C++ heades, not compatible with C. A bit further down, we see std::size_t being used:

extern int __xray_set_customevent_handler(void (*entry)(void *, std::size_t));

These issues seem to exist since XRay was introduced. Probably no tool tried to use this with C...
Fixing this should be straight-forward, replacing #include <cstddef> with #include <stddef.h>, #include <cstdint> with #include <stdint.h> and std::size_t with size_t.
But maybe we want to introduce a test to make sure that this header stays C compliant?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions