Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. =================================================================== RCS file: /ftp/cvs/cvsroot/src/usr.bin/xlint/lint1/cgram.y,v rcsdiff: /ftp/cvs/cvsroot/src/usr.bin/xlint/lint1/cgram.y,v: warning: Unknown phrases like `commitid ...;' are present. retrieving revision 1.60 retrieving revision 1.61 diff -u -p -r1.60 -r1.61 --- src/usr.bin/xlint/lint1/cgram.y 2014/04/17 17:29:24 1.60 +++ src/usr.bin/xlint/lint1/cgram.y 2014/04/18 00:23:46 1.61 @@ -1,5 +1,5 @@ %{ -/* $NetBSD: cgram.y,v 1.60 2014/04/17 17:29:24 christos Exp $ */ +/* $NetBSD: cgram.y,v 1.61 2014/04/18 00:23:46 christos Exp $ */ /* * Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved. @@ -35,7 +35,7 @@ #include #if defined(__RCSID) && !defined(lint) -__RCSID("$NetBSD: cgram.y,v 1.60 2014/04/17 17:29:24 christos Exp $"); +__RCSID("$NetBSD: cgram.y,v 1.61 2014/04/18 00:23:46 christos Exp $"); #endif #include @@ -189,11 +189,17 @@ static inline void RESTORE(const char *f %token T_ATTRIBUTE %token T_AT_ALIGNED %token T_AT_DEPRECATED +%token T_AT_NORETURN %token T_AT_MAY_ALIAS %token T_AT_PACKED +%token T_AT_PURE %token T_AT_TUINION %token T_AT_TUNION %token T_AT_UNUSED +%token T_AT_FORMAT +%token T_AT_FORMAT_PRINTF +%token T_AT_FORMAT_SCANF +%token T_AT_FORMAT_STRFTIME @@ -470,19 +476,33 @@ declaration: | error T_SEMI ; +type_attribute_format_type: + T_AT_FORMAT_PRINTF + | T_AT_FORMAT_SCANF + | T_AT_FORMAT_STRFTIME + ; + type_attribute_spec: T_AT_DEPRECATED | T_AT_ALIGNED T_LPARN constant T_RPARN | T_AT_MAY_ALIAS + | T_AT_NORETURN | T_AT_PACKED { addpacked(); } + | T_AT_PURE | T_AT_TUNION + | T_AT_FORMAT T_LPARN type_attribute_format_type T_COMMA + constant T_COMMA constant T_RPARN | T_AT_UNUSED ; type_attribute: - T_ATTRIBUTE T_LPARN T_LPARN type_attribute_spec T_RPARN T_RPARN + T_ATTRIBUTE T_LPARN T_LPARN { + attron = 1; + } type_attribute_spec { + attron = 0; + } T_RPARN T_RPARN | T_PACKED { addpacked(); }