Module Name: src
Committed By: christos
Date: Mon Apr 21 21:52:24 UTC 2014
Modified Files:
src/usr.bin/xlint/lint1: cgram.y scan.l
Log Message:
add more attributes
To generate a diff of this commit:
cvs rdiff -u -r1.64 -r1.65 src/usr.bin/xlint/lint1/cgram.y
cvs rdiff -u -r1.58 -r1.59 src/usr.bin/xlint/lint1/scan.l
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/usr.bin/xlint/lint1/cgram.y
diff -u src/usr.bin/xlint/lint1/cgram.y:1.64 src/usr.bin/xlint/lint1/cgram.y:1.65
--- src/usr.bin/xlint/lint1/cgram.y:1.64 Mon Apr 21 14:57:20 2014
+++ src/usr.bin/xlint/lint1/cgram.y Mon Apr 21 17:52:24 2014
@@ -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 @@ static inline void RESTORE(const char *f
%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_format_type:
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();
}
Index: src/usr.bin/xlint/lint1/scan.l
diff -u src/usr.bin/xlint/lint1/scan.l:1.58 src/usr.bin/xlint/lint1/scan.l:1.59
--- src/usr.bin/xlint/lint1/scan.l:1.58 Mon Apr 21 14:57:07 2014
+++ src/usr.bin/xlint/lint1/scan.l Mon Apr 21 17:52:24 2014
@@ -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 @@ static struct kwtab {
} 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 @@ static struct kwtab {
{ "__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 },