Skip to content

Please use (void) and not () #342

Closed

Description

@TApplencourt

For example in:
https://github.com/oneapi-src/level-zero/blob/de1e9f42641cf7513672c2f3a5c306034a4f7e96/include/loader/ze_loader.h#L97C16-L97C46

I suppose here you mean no parameter, not unknow number of parameters.

The other are

h2yaml diagnostic: modified_include/loader/ze_loader.h:71:1: Warning: `zelSetDriverTeardown` defines a function with no parameters, consider specifying `void`.
h2yaml diagnostic: modified_include/loader/ze_loader.h:77:1: Warning: `zelSetDelayLoaderContextTeardown` defines a function with no parameters, consider specifying `void`.
h2yaml diagnostic: modified_include/loader/ze_loader.h:83:1: Warning: `zelLoaderContextTeardown` defines a function with no parameters, consider specifying `void`.
h2yaml diagnostic: modified_include/loader/ze_loader.h:89:1: Warning: `zelEnableTracingLayer` defines a function with no parameters, consider specifying `void`.
h2yaml diagnostic: modified_include/loader/ze_loader.h:95:1: Warning: `zelCheckIsLoaderInTearDown` defines a function with no parameters, consider specifying `void`.
h2yaml diagnostic: modified_include/loader/ze_loader.h:136:1: Warning: `zelDisableTracingLayer` defines a function with no parameters, consider specifying `void`.

Activity

  1. eero-t commented on May 7, 2026

    @eero-t

    For C++ () has always meant (void), wheres the latest C23 standard finally applied same interpretation for C (requires -std=c23 option for GCC/Clang/LLVM).

    The indicated APIs are all in the API tracing layer ze_loader.h API header. Its users inside this project are all C++ code, so these APIs are interpreted correctly for them.

    But I do do agree that that this trivial fix should be done as it's a C-API for header included to level-zero-devel package, and LTS distros haven't enabled C23 for compilers yet.

    It's rather low impact though, as it's quite unlikely that there are:

    • Tracing layer implementations outside this project,
    • That are implemented in C (instead of e.g. C++), and
    • Would have a bug due to header assuming C++ / C23...
  2. TApplencourt commented on May 7, 2026

    @TApplencourt
    Author

    Agree. Pretty low impact, just a simple "beauty" fix.

    Concerning your two points:

    • Tracing layer implementations outside this project,
    • That are implemented in C (instead of e.g. C++)

    You have one: me ! 😄 (via https://github.com/argonne-lcf/THAPI/). But you are right, we don't trigger your third point.

  3. eero-t commented on May 7, 2026

    @eero-t

    Thanks, that looks interesting project! As you're supporting many different APIs, I guess -std=c23 is out of question, at least currently.

    (I'm not loader maintainer, just another user of L0 APIs.)

  4. TApplencourt commented on May 8, 2026

    @TApplencourt
    Author

    (I'm not loader maintainer, just another user of L0 APIs.)

    :D Their is dozen of us. Dozen!

  5. rwmcguir commented on Jul 15, 2026

    @rwmcguir
    Contributor

    @TApplencourt Please take a look at the attached review and see if this resolves your issue.

  6. self-assigned this
    on Jul 15, 2026
  7. TApplencourt commented on Jul 16, 2026

    @TApplencourt
    Author

    Thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions