mirror of https://github.com/sysown/proxysql
Three identical SonarCloud BUG-severity findings (one per file) on the
truncate-via-temporary idiom:
std::ofstream(g_log_path, std::ios::trunc);
This creates a temporary std::ofstream whose destructor closes the file
— the truncate is the intended side effect. SonarCloud's rule "Name
this unused temporary object or remove it" does not understand the
side-effect pattern and flags it as a BUG.
Issue #5674 triaged all 3 BUG findings as false positives. This commit
silences them with the cosmetic fix recommended in that issue: give
the temporary a name and (void)-cast it. Same generated code, no
behaviour change, but Sonar stops flagging it.
Files: test/tap/tests/unit/plugin_{config,lifecycle,manager}_unit-t.cpp
fix/test-mysqlx-plugin-load-phase-b
parent
ccc6648e06
commit
baeca0e3dc
Loading…
Reference in new issue