Skip to content

Inconsistent semicolon use in GPU macros #592

@JuanDiegoMontoya

Description

@JuanDiegoMontoya

In TracyOpenGL.hpp, there are several macros that have a semicolon at the end, contrary to other macros in the API. This inconsistency causes some minor issues:

  • Manually adding the semicolon after using the macro causes some linters to complain about a statement that has no effect
  • Omitting the semicolon after the macro creates an (seemingly) inconsistent style, and causes some IDEs to add an extra indentation to the next line

The following macros are affected:

  • TracyGpuNamedZone
  • TracyGpuNamedZoneC
  • TracyGpuZoneTransient
  • TracyGpuCollect
  • TracyGpuNamedZoneS
  • TracyGpuNamedZoneCS
  • TracyGpuZoneTransientS

Additionally, if TRACY_HAS_CALLSTACK is not defined, the latter four macros will not have an implicit semicolon at the end, leading to further inconsistent behavior (for example, the application not compiling if the user relied on the semicolon that was previously there).

At a glance, the issue appears to affect all of the other GPU headers (TracyVulkan.hpp, TracyD3D11.hpp, TracyD3D12.hpp, and TracyOpenCL.hpp).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions