]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
c: support the attribute starting with '_'
authorMartin Liska <mliska@suse.cz>
Wed, 5 Oct 2022 10:34:30 +0000 (12:34 +0200)
committerMartin Liska <mliska@suse.cz>
Wed, 5 Oct 2022 12:53:10 +0000 (14:53 +0200)
PR c/107156

gcc/ChangeLog:

* attribs.h (lookup_attribute_by_prefix): Support the attribute
starting with underscore (_Noreturn).

gcc/attribs.h

index b2836560fc215ceebc2d9e847776b7cda295137a..121b9ebbc39ac755af5e1c182a4ebb62ac4238b0 100644 (file)
@@ -274,8 +274,8 @@ lookup_attribute_by_prefix (const char *attr_name, tree list)
            }
 
          const char *p = IDENTIFIER_POINTER (name);
-         gcc_checking_assert (attr_len == 0 || p[0] != '_');
-
+         gcc_checking_assert (attr_len == 0 || p[0] != '_'
+                              || (ident_len > 1 && p[1] != '_'));
          if (strncmp (attr_name, p, attr_len) == 0)
            break;