Skip to content

Commit 7f5ed57

Browse files
committed
Ignore clang build warning given empty tracer params
Signed-off-by: Neil R. Spruit <neil.r.spruit@intel.com>
1 parent 808cc2e commit 7f5ed57

2 files changed

Lines changed: 21 additions & 1 deletion

File tree

include/layers/zel_tracing_register_cb.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2726,9 +2726,16 @@ typedef void (ZE_APICALL *zer_pfnTranslateIdentifierToDeviceHandleCb_t)(
27262726
/// @details Each entry is a pointer to the parameter passed to the function;
27272727
/// allowing the callback the ability to modify the parameter's value
27282728

2729+
#ifdef __clang__
2730+
#pragma clang diagnostic push
2731+
#pragma clang diagnostic ignored "-Wextern-c-compat"
2732+
#endif
27292733
typedef struct _zer_get_default_context_params_t
27302734
{
27312735
} zer_get_default_context_params_t;
2736+
#ifdef __clang__
2737+
#pragma clang diagnostic pop
2738+
#endif
27322739

27332740

27342741
///////////////////////////////////////////////////////////////////////////////

scripts/templates/tracing/trc_setters.h.mako

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,17 +44,30 @@ typedef struct _zel_tracer_handle_t *zel_tracer_handle_t;
4444
%for obj in tbl['functions']:
4545
<%
4646
ret_type = obj['return_type']
47+
params_list = th.make_param_lines(n, tags, obj, format=["type*", "name"])
48+
is_void_params = len(params_list) == 0
4749
%>///////////////////////////////////////////////////////////////////////////////
4850
/// @brief Callback function parameters for ${th.make_func_name(n, tags, obj)}
4951
/// @details Each entry is a pointer to the parameter passed to the function;
5052
/// allowing the callback the ability to modify the parameter's value
5153

54+
%if is_void_params:
55+
#ifdef __clang__
56+
#pragma clang diagnostic push
57+
#pragma clang diagnostic ignored "-Wextern-c-compat"
58+
#endif
59+
%endif
5260
typedef struct _${th.make_pfncb_param_type(n, tags, obj)}
5361
{
54-
%for line in th.make_param_lines(n, tags, obj, format=["type*", "name"]):
62+
%for line in params_list:
5563
${line};
5664
%endfor
5765
} ${th.make_pfncb_param_type(n, tags, obj)};
66+
%if is_void_params:
67+
#ifdef __clang__
68+
#pragma clang diagnostic pop
69+
#endif
70+
%endif
5871

5972

6073
///////////////////////////////////////////////////////////////////////////////

0 commit comments

Comments
 (0)