https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116545

            Bug ID: 116545
           Summary: Support old style statement attributes
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: andi-gcc at firstfloor dot org
  Target Milestone: ---

Forked from PR83324. Applies to C/C++

It seems clang supports old style __attribute__ label attributes for musttail
(and presumably others) while gcc only supports the standard [[ ]] attributes.

With musttail working existing code that does

extern void foo(void);
void func(void)
{
#if __has_attribute(musttail)
    __attribute__((musttail))
#endif
    return foo();
}

builds on clang, but not on gcc. Bradley Lucier's scheme compiler does this
(see https://gcc.gnu.org/pipermail/gcc-help/2024-August/143676.html)

Short term we could make __has_attribute fails for just "musttail" (shouldn't
it be gnu::musttail or clang::musttail anyways?)

Or we support the old style attributes too which might be more compatible.
  • [Bug c/116545] New: Support ol... andi-gcc at firstfloor dot org via Gcc-bugs

Reply via email to