Open
Description
Bugzilla Link | 47487 |
Version | unspecified |
OS | All |
Blocks | #4440 |
CC | @DougGregor,@isanbard,@jyknight,@zygoloid |
Extended Description
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 */
^