Skip to content

RULE-5-10-1 reports false positives on compiler-predefined function identifiers (__func__, __FUNCTION__, __PRETTY_FUNCTION__) #1170

Closed

Description

@castler

Affected rules

  • RULE-5-10-1

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)

Activity

  1. added 2 commits that reference this issue on Aug 4, 2026
    5ee9d5f
    8bcf85d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    false positive/false negativeAn issue related to observed false positives or false negatives.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions