False positive on cpp:S1238

  • Operating system: Win 10-64
  • IDE name and flavor/env: VS 2022 17.7.0
  • Version:

And a thorough description of the problem / question:

Consider the following method:

inline __m256 __vectorcall Poly2Y_8f(const __m256 x, const __m256 a, const __m256 b, const __m256 c) noexcept(true)
return mm256_fmadd_ps(
mm256_fmadd_ps(a, x, b),

cpp:S1238 suggests that the arguments be passed by reference. However, these are passed by registers and should not be passed by reference.

Hi Ian,

Thanks for reporting this false positive. Passing “large” values by reference (to const) indeed does not hold for these wide registers.

I created a ticket to exempt these special types from this rule. Feel free to track progress at [CPP-4607] - Jira.


1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.