Skip to content

Commit b6835dd

Browse files
Fix the clang issue due to empty structure in the Tracing Layer
A dummy void pointer is added whenever the structure to be generated is empty. Related-To: NEO-17790 Signed-off-by: Pratik Bari <pratik.bari@intel.com>
1 parent 834f6a7 commit b6835dd

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

include/layers/zel_tracing_register_cb.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2728,6 +2728,7 @@ typedef void (ZE_APICALL *zer_pfnTranslateIdentifierToDeviceHandleCb_t)(
27282728

27292729
typedef struct _zer_get_default_context_params_t
27302730
{
2731+
void* dummy; // Placeholder for empty parameter list
27312732
} zer_get_default_context_params_t;
27322733

27332734

scripts/templates/tracing/trc_setters.h.mako

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,16 +44,21 @@ typedef struct _zel_tracer_handle_t *zel_tracer_handle_t;
4444
%for obj in tbl['functions']:
4545
<%
4646
ret_type = obj['return_type']
47+
param_lines = th.make_param_lines(n, tags, obj, format=["type*", "name"])
4748
%>///////////////////////////////////////////////////////////////////////////////
4849
/// @brief Callback function parameters for ${th.make_func_name(n, tags, obj)}
4950
/// @details Each entry is a pointer to the parameter passed to the function;
5051
/// allowing the callback the ability to modify the parameter's value
5152

5253
typedef struct _${th.make_pfncb_param_type(n, tags, obj)}
5354
{
54-
%for line in th.make_param_lines(n, tags, obj, format=["type*", "name"]):
55+
%if param_lines:
56+
%for line in param_lines:
5557
${line};
5658
%endfor
59+
%else:
60+
void* dummy; // Placeholder for empty parameter list
61+
%endif
5762
} ${th.make_pfncb_param_type(n, tags, obj)};
5863

5964

0 commit comments

Comments
 (0)