Skip to content

Commit ec28bff

Browse files
committed
genksyms: decouple ATTRIBUTE_PHRASE from type-qualifier
The __attribute__ keyword can appear in more contexts than 'const' or 'volatile'. To avoid grammatical conflicts with future changes, ATTRIBUTE_PHRASE should not be reduced into type_qualifier. No functional changes are intended. Signed-off-by: Masahiro Yamada <[email protected]> Acked-by: Nicolas Schier <[email protected]>
1 parent ccc11a1 commit ec28bff

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

scripts/genksyms/parse.y

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,7 @@ decl_specifier:
216216
}
217217
| type_specifier { dont_want_type_specifier = true; $$ = $1; }
218218
| type_qualifier
219+
| ATTRIBUTE_PHRASE
219220
;
220221

221222
storage_class_specifier:
@@ -285,11 +286,13 @@ type_qualifier_seq_opt:
285286

286287
type_qualifier_seq:
287288
type_qualifier
289+
| ATTRIBUTE_PHRASE
288290
| type_qualifier_seq type_qualifier { $$ = $2; }
291+
| type_qualifier_seq ATTRIBUTE_PHRASE { $$ = $2; }
289292
;
290293

291294
type_qualifier:
292-
CONST_KEYW | VOLATILE_KEYW | ATTRIBUTE_PHRASE
295+
CONST_KEYW | VOLATILE_KEYW
293296
| RESTRICT_KEYW
294297
{ /* restrict has no effect in prototypes so ignore it */
295298
remove_node($1);

0 commit comments

Comments
 (0)