yaml-cpp icon indicating copy to clipboard operation
yaml-cpp copied to clipboard

Weffc++ broken for gcc 8 and intel compilers

Open rjk9w5 opened this issue 5 years ago • 5 comments
trafficstars

Since this option is a known bug in these compilers, I think it would be worth while to turn if off when they are active.

rjk9w5 avatar Aug 12 '20 20:08 rjk9w5

"this option is a known bug" - In order to document it, can you link to the bug in bugzilla?

TedLyngmo avatar Aug 21 '20 08:08 TedLyngmo

It looks like I was wrong, it is only a known issue in GCC.

I am not surprised Intel doesn't know about the bug, that seems like their mo..., but it basically interprets header guards with numbers in them as if they are defining globals constants. Personally, the IDE generated header guard should probably just be a #pragma once, and maybe that is the fix for this. If you have access to the Intel 2019 compiler you can generate the false positive yourself. Otherwise I can attach it here Monday.

GCC issue https://bugzilla.redhat.com/show_bug.cgi?id=1544675

rjk9w5 avatar Aug 21 '20 12:08 rjk9w5

GCC issue https://bugzilla.redhat.com/show_bug.cgi?id=1544675

Aha, that old thingy again. I referred to it in 0d5c57150cebb430fcc216d8066dbb28aeaafe8e when I added -Wshadow -Weffc++ -pedantic -pedantic-errors. :-)

TedLyngmo avatar Aug 28 '20 08:08 TedLyngmo

I added some logic to turn these off in the CMake for the affected compilers.

I think it is worth disabling these for these compilers until there is good enough support for these options to compile without tons of false positives. Agree/disagree?

rjk9w5 avatar Oct 06 '20 20:10 rjk9w5

Also, after some more testing, I found that the latest GCC still has this issue.

rjk9w5 avatar Oct 06 '20 20:10 rjk9w5