lf-lang / reactor-c

A reactor runtime written in C
Other
10 stars 23 forks source link

Update trace-plugin API #428

Closed erlingrj closed 1 month ago

erlingrj commented 1 month ago

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