server icon indicating copy to clipboard operation
server copied to clipboard

Fixes for Clang warnings

Open HennerM opened this issue 1 year ago • 2 comments

I was trying to compile triton server with default Clang 15 and got a few warnings that triggered as errors, among those:

  • deprecation errors from open telemetry showing up, which shouldn't be an issue here. They come up because the headers aren't included as "SYSTEM" headers.
  • unused parameter in TritonParser::SetGlobalTraceArgs(). There is a explicit_disable_trace passed as bool, that was updated but never read. I believe this was intended to be a bool& @oandreeva-nv ? (error: parameter 'explicit_disable_trace' set but not used [-Werror,-Wunused-but-set-parameter])
  • An unused [this] capture (-Wunused-lambda-capture)
  • Assignment with std::move of temporary variable resulting in: error: moving a temporary object prevents copy elision [-Werror,-Wpessimizing-move] I am not quite sure what's the problem, but I think the std::move is redundant here anyway?
  • a few conditionally uninitialised variables in tests variable 'ba_memory_type' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized]
  • unused private field in HTTPAPIServer: error: private field 'end_' is not used [-Werror,-Wunused-private-field] bool end_{false};

There is more in the core and backend repos that I will raise separately

HennerM avatar Jan 07 '24 17:01 HennerM

Hi @HennerM, thanks for the contributions, these look great! Can you update the branch and resolve the conflicts? Then we can run some quick tests to make sure nothing breaks and approve.

rmccorm4 avatar Feb 09 '24 20:02 rmccorm4

~~Also just to double check, have you sent in a CLA as described here: https://github.com/triton-inference-server/server/blob/main/CONTRIBUTING.md#contributor-license-agreement-cla?~~ Nevermind, I see one already filled out for you and Speechmatics.

rmccorm4 avatar Feb 09 '24 20:02 rmccorm4