Module Name: src
Committed By: christos
Date: Sat Nov 24 13:10:21 UTC 2018
Modified Files:
src/usr.bin/xlint/lint1: cgram.y scan.l
Log Message:
add warn_unused_result.
To generate a diff of this commit:
cvs rdiff -u -r1.98 -r1.99 src/usr.bin/xlint/lint1/cgram.y
cvs rdiff -u -r1.84 -r1.85 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.98 src/usr.bin/xlint/lint1/cgram.y:1.99
--- src/usr.bin/xlint/lint1/cgram.y:1.98 Mon Sep 3 11:16:33 2018
+++ src/usr.bin/xlint/lint1/cgram.y Sat Nov 24 08:10:20 2018
@@ -1,5 +1,5 @@
%{
-/* $NetBSD: cgram.y,v 1.98 2018/09/03 15:16:33 christos Exp $ */
+/* $NetBSD: cgram.y,v 1.99 2018/11/24 13:10:20 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.98 2018/09/03 15:16:33 christos Exp $");
+__RCSID("$NetBSD: cgram.y,v 1.99 2018/11/24 13:10:20 christos Exp $");
#endif
#include <stdlib.h>
@@ -234,6 +234,7 @@ anonymize(sym_t *s)
%token <y_type> T_AT_UNUSED
%token <y_type> T_AT_USED
%token <y_type> T_AT_VISIBILITY
+%token <y_type> T_AT_WARN_UNUSED_RESULT
%token <y_type> T_AT_WEAK
%left T_COMMA
@@ -561,6 +562,7 @@ type_attribute_spec:
| T_AT_UNUSED {
addused();
}
+ | T_AT_WARN_UNUSED_RESULT
| T_AT_WEAK
| T_AT_VISIBILITY T_LPARN constant T_RPARN
| T_QUAL {
Index: src/usr.bin/xlint/lint1/scan.l
diff -u src/usr.bin/xlint/lint1/scan.l:1.84 src/usr.bin/xlint/lint1/scan.l:1.85
--- src/usr.bin/xlint/lint1/scan.l:1.84 Sun Oct 7 10:20:01 2018
+++ src/usr.bin/xlint/lint1/scan.l Sat Nov 24 08:10:20 2018
@@ -1,5 +1,5 @@
%{
-/* $NetBSD: scan.l,v 1.84 2018/10/07 14:20:01 christos Exp $ */
+/* $NetBSD: scan.l,v 1.85 2018/11/24 13:10:20 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.84 2018/10/07 14:20:01 christos Exp $");
+__RCSID("$NetBSD: scan.l,v 1.85 2018/11/24 13:10:20 christos Exp $");
#endif
#include <stdlib.h>
@@ -291,6 +291,7 @@ static struct kwtab {
{ "visibility", T_AT_VISIBILITY,0, 0, 0, 0,0,1,1,5 },
{ "void", T_TYPE, 0, VOID, 0, 0,0,0,0,1 },
{ "volatile", T_QUAL, 0, 0, VOLATILE, 1,0,0,0,7 },
+ { "warn_unused_result", T_AT_WARN_UNUSED_RESULT, 0, 0, 0, 0,0,1,1,5 },
{ "weak", T_AT_WEAK, 0, 0, 0, 0,0,1,1,5 },
{ "while", T_WHILE, 0, 0, 0, 0,0,0,0,1 },
{ NULL, 0, 0, 0, 0, 0,0,0,0,0 }