Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update trace-plugin API #428

Merged
merged 1 commit into from
May 15, 2024
Merged

Update trace-plugin API #428

merged 1 commit into from
May 15, 2024

Conversation

erlingrj
Copy link
Collaborator

@erlingrj erlingrj commented May 14, 2024

When using CCpp and clang the current trace API yielded the following C-linkage warning:

/home/erling/dev/xronos/lf-trace-example/src-gen/SimpleCCpp/trace/api/trace.h/home/erling/dev/xronos/lf-trace-example/src-gen/SimpleCCpp/trace/api/trace.h:13::1311::11 : warning: warning: 'lf_version_tracing' has C-linkage specified, but returns user-defined type 'version_t' which is incompatible with C [-Wreturn-type-c-linkage]'lf_version_tracing' has C-linkage specified, but returns user-defined type 'version_t' which is incompatible with C [-Wreturn-type-c-linkage]

version_t lf_version_tracing();
          ^version_t lf_version_tracing();

This is solved by instead returning a const pointer to the version struct. The version struct is then instead a constant global variable in the trace plugins. As this changes the trace plugin API this requires updating any external trace plugins also

This avoids a c-linkage warning for CCpp+clang
@erlingrj erlingrj added the enhancement Enhancement of existing feature label May 14, 2024
@erlingrj erlingrj requested a review from lhstrh May 14, 2024 10:52
@lhstrh lhstrh added this pull request to the merge queue May 15, 2024
Merged via the queue into main with commit 3c1fffa May 15, 2024
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhancement of existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants