Affected rules
Description
The query flags the compiler-predefined function identifiers __func__, __FUNCTION__ and __PRETTY_FUNCTION__ for "contains double underscores" / "starts with underscore". These are not user-defined
identifiers — __func__ is mandated by the C++ standard ([dcl.fct.def.general]) and FUNCTION/PRETTY_FUNCTION` are GCC/Clang extensions — so RULE-5-10-1 (which is scoped to user-defined identifiers) should not report them.
Example
The compiler synthesizes one such static const char __PRETTY_FUNCTION__[] = "..." inside every function that
references it. These references very often come from assert-style macros (e.g. an ASSERT_MESSAGE(...) macro that embeds __PRETTY_FUNCTION__), so the synthesized variable is attributed to each macro invocation site in user
code. The result is one false positive per macro usage.
e.g. https://github.com/eclipse-score/baselibs/blob/ebe13d853e87ce067507212ff736af14b7941f6d/score/language/futurecpp/include/score/private/assert/assert_impl.hpp#L50
Impact
In score/communication this causes ~79% of all RULE-5-10-1 findings (228)
Affected rules
Description
The query flags the compiler-predefined function identifiers
__func__,__FUNCTION__and__PRETTY_FUNCTION__for "contains double underscores" / "starts with underscore". These are not user-definedidentifiers —
__func__is mandated by the C++ standard ([dcl.fct.def.general]) and FUNCTION/PRETTY_FUNCTION` are GCC/Clang extensions — so RULE-5-10-1 (which is scoped to user-defined identifiers) should not report them.Example
The compiler synthesizes one such
static const char __PRETTY_FUNCTION__[] = "..."inside every function thatreferences it. These references very often come from assert-style macros (e.g. an
ASSERT_MESSAGE(...)macro that embeds__PRETTY_FUNCTION__), so the synthesized variable is attributed to each macro invocation site in usercode. The result is one false positive per macro usage.
e.g. https://github.com/eclipse-score/baselibs/blob/ebe13d853e87ce067507212ff736af14b7941f6d/score/language/futurecpp/include/score/private/assert/assert_impl.hpp#L50
Impact
In score/communication this causes ~79% of all RULE-5-10-1 findings (228)