Skip to content

C explicit_casts: a function declarator followed by an attribute, f(void) __attribute__((noreturn)), counts as a cast #9433

Backlog

Description

@squid-protocol

Found by the SOP-002 gap-cell decoy work (protocol SOP-002-v1, epic #8863), batch c (Req D, cross-construct negative).

c.py explicit_casts is \(\s*(?:int|...|void)[ \t\n]*(?:\*[ \t\n]*)*\)\s*[ID_START]. A prototype whose parameter list is (void) followed by an identifier-start token (a GNU attribute or a glibc macro) is matched as the cast (void) name.

Snippets:

void abort(void) __attribute__((noreturn));
extern int f(void) __THROW;

Expected: explicit_casts 0 (declarations, no value is converted). Actual: 1 each. Controls: void f(void); -> 0, int main(void) { -> 0, (void)y; -> 1.

Activity

  1. added
    bug
    on Nov 26, 2026
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

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions