From 51c91e52e514c6f263f46cd608c38693e3ad2035 Mon Sep 17 00:00:00 2001 From: christos Date: Sat, 24 Nov 2018 13:10:20 +0000 Subject: [PATCH] add warn_unused_result. --- usr.bin/xlint/lint1/cgram.y | 6 ++++-- usr.bin/xlint/lint1/scan.l | 5 +++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/usr.bin/xlint/lint1/cgram.y b/usr.bin/xlint/lint1/cgram.y index 1802da9f6a35..1bdd9bf9c867 100644 --- a/usr.bin/xlint/lint1/cgram.y +++ b/usr.bin/xlint/lint1/cgram.y @@ -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 #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 @@ -234,6 +234,7 @@ anonymize(sym_t *s) %token T_AT_UNUSED %token T_AT_USED %token T_AT_VISIBILITY +%token T_AT_WARN_UNUSED_RESULT %token 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 { diff --git a/usr.bin/xlint/lint1/scan.l b/usr.bin/xlint/lint1/scan.l index e3e2776b694b..138e2d3eefa9 100644 --- a/usr.bin/xlint/lint1/scan.l +++ b/usr.bin/xlint/lint1/scan.l @@ -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 #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 @@ -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 }