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 returns_nonnull attribute
details: https://anonhg.NetBSD.org/src/rev/c5d6462ba3d8
branches: trunk
changeset: 985319:c5d6462ba3d8
user: christos <christos%NetBSD.org@localhost>
date: Thu Aug 19 08:59:22 2021 +0000
description:
Add returns_nonnull attribute
diffstat:
usr.bin/xlint/lint1/cgram.y | 6 ++++--
usr.bin/xlint/lint1/lex.c | 5 +++--
2 files changed, 7 insertions(+), 4 deletions(-)
diffs (61 lines):
diff -r e9ec559794ff -r c5d6462ba3d8 usr.bin/xlint/lint1/cgram.y
--- a/usr.bin/xlint/lint1/cgram.y Thu Aug 19 08:53:21 2021 +0000
+++ b/usr.bin/xlint/lint1/cgram.y Thu Aug 19 08:59:22 2021 +0000
@@ -1,5 +1,5 @@
%{
-/* $NetBSD: cgram.y,v 1.355 2021/08/11 05:19:32 rillig Exp $ */
+/* $NetBSD: cgram.y,v 1.356 2021/08/19 08:59:22 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.355 2021/08/11 05:19:32 rillig Exp $");
+__RCSID("$NetBSD: cgram.y,v 1.356 2021/08/19 08:59:22 christos Exp $");
#endif
#include <limits.h>
@@ -248,6 +248,7 @@
%token T_AT_PACKED
%token T_AT_PCS
%token T_AT_PURE
+%token T_AT_RETURNS_NONNULL
%token T_AT_RETURNS_TWICE
%token T_AT_SECTION
%token T_AT_SENTINEL
@@ -2076,6 +2077,7 @@
}
| T_AT_PCS T_LPAREN string T_RPAREN
| T_AT_PURE
+ | T_AT_RETURNS_NONNULL
| T_AT_RETURNS_TWICE
| T_AT_SECTION T_LPAREN string T_RPAREN
| T_AT_SENTINEL T_LPAREN constant_expr T_RPAREN
diff -r e9ec559794ff -r c5d6462ba3d8 usr.bin/xlint/lint1/lex.c
--- a/usr.bin/xlint/lint1/lex.c Thu Aug 19 08:53:21 2021 +0000
+++ b/usr.bin/xlint/lint1/lex.c Thu Aug 19 08:59:22 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: lex.c,v 1.62 2021/08/01 08:03:43 rillig Exp $ */
+/* $NetBSD: lex.c,v 1.63 2021/08/19 08:59:22 christos Exp $ */
/*
* Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved.
@@ -38,7 +38,7 @@
#include <sys/cdefs.h>
#if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: lex.c,v 1.62 2021/08/01 08:03:43 rillig Exp $");
+__RCSID("$NetBSD: lex.c,v 1.63 2021/08/19 08:59:22 christos Exp $");
#endif
#include <ctype.h>
@@ -204,6 +204,7 @@
kwdef_sclass( "register", REG, 0,0,0,0,1),
kwdef_tqual( "restrict", RESTRICT, 0,1,0,0,5),
kwdef_keyword( "return", T_RETURN),
+ kwdef_gcc_attr( "returns_nonnull",T_AT_RETURNS_NONNULL),
kwdef_gcc_attr( "returns_twice",T_AT_RETURNS_TWICE),
kwdef_gcc_attr( "scanf", T_AT_FORMAT_SCANF),
kwdef_token( "section", T_AT_SECTION, 0,0,1,1,7),
Home |
Main Index |
Thread Index |
Old Index