Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/xlint/lint1 add more attributes



details:   https://anonhg.NetBSD.org/src/rev/e993bb59eb3f
branches:  trunk
changeset: 328872:e993bb59eb3f
user:      christos <christos%NetBSD.org@localhost>
date:      Mon Apr 21 21:52:24 2014 +0000

description:
add more attributes

diffstat:

 usr.bin/xlint/lint1/cgram.y |  14 ++++++++++----
 usr.bin/xlint/lint1/scan.l  |  13 +++++++++++--
 2 files changed, 21 insertions(+), 6 deletions(-)

diffs (87 lines):

diff -r 27b9936a10f3 -r e993bb59eb3f usr.bin/xlint/lint1/cgram.y
--- a/usr.bin/xlint/lint1/cgram.y       Mon Apr 21 20:24:21 2014 +0000
+++ b/usr.bin/xlint/lint1/cgram.y       Mon Apr 21 21:52:24 2014 +0000
@@ -1,5 +1,5 @@
 %{
-/* $NetBSD: cgram.y,v 1.64 2014/04/21 18:57:20 christos Exp $ */
+/* $NetBSD: cgram.y,v 1.65 2014/04/21 21:52:24 christos Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -35,7 +35,7 @@
 
 #include <sys/cdefs.h>
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: cgram.y,v 1.64 2014/04/21 18:57:20 christos Exp $");
+__RCSID("$NetBSD: cgram.y,v 1.65 2014/04/21 21:52:24 christos Exp $");
 #endif
 
 #include <stdlib.h>
@@ -200,8 +200,10 @@
 %token <y_type>                T_AT_FORMAT_PRINTF
 %token <y_type>                T_AT_FORMAT_SCANF
 %token <y_type>                T_AT_FORMAT_STRFTIME
-
-
+%token <y_type>                T_AT_FORMAT_ARG
+%token <y_type>                T_AT_SENTINEL
+%token <y_type>                T_AT_RETURNS_TWICE
+%token <y_type>                T_AT_COLD
 
 %left  T_COMMA
 %right T_ASSIGN T_OPASS
@@ -485,8 +487,12 @@
 type_attribute_spec:
          T_AT_DEPRECATED
        | T_AT_ALIGNED T_LPARN constant T_RPARN
+       | T_AT_SENTINEL T_LPARN constant T_RPARN
+       | T_AT_FORMAT_ARG T_LPARN constant T_RPARN
        | T_AT_MAY_ALIAS
        | T_AT_NORETURN
+       | T_AT_COLD
+       | T_AT_RETURNS_TWICE
        | T_AT_PACKED {
                addpacked();
        }
diff -r 27b9936a10f3 -r e993bb59eb3f usr.bin/xlint/lint1/scan.l
--- a/usr.bin/xlint/lint1/scan.l        Mon Apr 21 20:24:21 2014 +0000
+++ b/usr.bin/xlint/lint1/scan.l        Mon Apr 21 21:52:24 2014 +0000
@@ -1,5 +1,5 @@
 %{
-/* $NetBSD: scan.l,v 1.58 2014/04/21 18:57:07 christos Exp $ */
+/* $NetBSD: scan.l,v 1.59 2014/04/21 21:52:24 christos Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -35,7 +35,7 @@
 
 #include <sys/cdefs.h>
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: scan.l,v 1.58 2014/04/21 18:57:07 christos Exp $");
+__RCSID("$NetBSD: scan.l,v 1.59 2014/04/21 21:52:24 christos Exp $");
 #endif
 
 #include <stdlib.h>
@@ -203,6 +203,7 @@
 } kwtab[] = {
        { "__alignof__", T_ALIGNOF,     0,      0,      0,        0, 0, 0, 0 },
        { "__attribute__",T_ATTRIBUTE,  0,      0,      0,        0, 0, 1, 0 },
+       { "__attribute",T_ATTRIBUTE,    0,      0,      0,        0, 0, 1, 0 },
        { "__packed__", T_AT_PACKED,    0,      0,      0,        0, 0, 1, 1 },
        { "packed",     T_AT_PACKED,    0,      0,      0,        0, 0, 1, 1 },
        { "__aligned__",T_AT_ALIGNED,   0,      0,      0,        0, 0, 1, 1 },
@@ -227,6 +228,14 @@
        { "__pure__",   T_AT_PURE,      0,      0,      0,        0, 0, 1, 1 },
        { "noreturn",   T_AT_NORETURN,  0,      0,      0,        0, 0, 1, 1 },
        { "__noreturn__",T_AT_NORETURN, 0,      0,      0,        0, 0, 1, 1 },
+       { "sentinel",   T_AT_SENTINEL,  0,      0,      0,        0, 0, 1, 1 },
+       { "__sentinel__",T_AT_SENTINEL, 0,      0,      0,        0, 0, 1, 1 },
+       { "format_arg", T_AT_FORMAT_ARG,0,      0,      0,        0, 0, 1, 1 },
+       { "__format_arg__", T_AT_FORMAT_ARG,0,  0,      0,        0, 0, 1, 1 },
+       { "returns_twice", T_AT_RETURNS_TWICE,0,0,      0,        0, 0, 1, 1 },
+       { "__returns_twice__", T_AT_RETURNS_TWICE,0,0,  0,        0, 0, 1, 1 },
+       { "cold",       T_AT_COLD,      0,      0,      0,        0, 0, 1, 1 },
+       { "__cold__",   T_AT_COLD,      0,      0,      0,        0, 0, 1, 1 },
        { "asm",        T_ASM,          0,      0,      0,        0, 0, 1, 0 },
        { "__asm",      T_ASM,          0,      0,      0,        0, 0, 0, 0 },
        { "__asm__",    T_ASM,          0,      0,      0,        0, 0, 0, 0 },



Home | Main Index | Thread Index | Old Index