https://bugs.llvm.org/show_bug.cgi?id=47487

            Bug ID: 47487
           Summary: support for GNU C label attributes
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C
          Assignee: unassignedclangb...@nondot.org
          Reporter: ndesaulni...@google.com
                CC: blitzrak...@gmail.com, dgre...@apple.com,
                    erik.pilking...@gmail.com, isanb...@gmail.com,
                    jykni...@google.com, llvm-bugs@lists.llvm.org,
                    richard-l...@metafoo.co.uk

https://gcc.gnu.org/onlinedocs/gcc/Label-Attributes.html#Label-Attributes
https://godbolt.org/z/Er3rP8

#include <stdio.h>
int foo(void) {
       asm goto ("some asm" : : : : NoError);

/* This branch (the fall-through from the asm) is less commonly used */
ErrorHandling: 
   __attribute__((cold, unused)); /* Semi-colon is required here */
   printf("error\n");
   return 0;

NoError:
   printf("no error\n");
   return 1;
}

clang:
warning: 'cold' attribute only applies to functions [-Wignored-attributes]

   __attribute__((cold, unused)); /* Semi-colon is required here */

                  ^

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to