Skip to content

Commit b62852e

Browse files
authored
Ignore clang build warning given empty tracer params (#438)
Signed-off-by: Neil R. Spruit <neil.r.spruit@intel.com>
1 parent 808cc2e commit b62852e

File tree

3 files changed

+64
-1
lines changed

3 files changed

+64
-1
lines changed

.github/workflows/build-clang.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
on:
2+
push:
3+
branches: [ master,release_branch* ]
4+
pull_request:
5+
branches: [ master,release_branch* ]
6+
workflow_dispatch:
7+
8+
permissions: read-all
9+
10+
jobs:
11+
build-clang-linux:
12+
if: github.repository_owner == 'oneapi-src'
13+
runs-on: ubuntu-latest
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
container:
18+
- ubuntu:22.04
19+
- ubuntu:24.04
20+
build_type:
21+
- static
22+
- dynamic
23+
container:
24+
image: ${{ matrix.container }}
25+
steps:
26+
- name: Install dependencies
27+
run: |
28+
apt-get update
29+
apt-get install -y clang cmake make git
30+
- uses: actions/checkout@v4
31+
- name: Build Loader (${{ matrix.build_type }}) with Clang on ${{ matrix.container }}
32+
run: |
33+
mkdir build
34+
cd build
35+
cmake \
36+
-D CMAKE_C_COMPILER=clang \
37+
-D CMAKE_CXX_COMPILER=clang++ \
38+
-D CMAKE_BUILD_TYPE=Release \
39+
-D BUILD_L0_LOADER_TESTS=1 \
40+
-D INSTALL_NULL_DRIVER=1 \
41+
-D BUILD_STATIC=${{ matrix.build_type == 'static' && '1' || '0' }} \
42+
..
43+
cmake --build . --config Release

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)