GCC analyzer false positive
Iain Buclaw
ibuclaw at gdcproject.org
Fri Sep 22 09:11:58 UTC 2023
On Thursday, 31 August 2023 at 13:53:55 UTC, Zachary Yedidia
wrote:
> The following code generates a warning when using GCC analyzer,
> but I don't think the warning is valid.
>
> ```
> struct Guard {
> ~this() {}
> }
> Guard lock() {
> return Guard();
> }
> void bar() {
> auto foo = lock();
> }
> ```
>
> Compiled with GCC version 13.1:
>
I'm at the GNU Cauldron, and David has just said "don't use
-fanalyzer on C++ in GCC 13, you will get rubbish out of it".
This would also extend to all other languages that aren't C too.
The good news is that things are going to be improved in GCC 14.
More information about the D.gnu
mailing list