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 lint: only allow GCC attribute in null s...
details: https://anonhg.NetBSD.org/src/rev/02952e1b8665
branches: trunk
changeset: 365857:02952e1b8665
user: rillig <rillig%NetBSD.org@localhost>
date: Fri Apr 29 07:02:40 2022 +0000
description:
lint: only allow GCC attribute in null statement
The only indented usage in that position is a fallthrough statement, as
a replacement for a /* FALLTHROUGH */ comment. There is no point in
using _Noreturn or _Alignas as a statement.
Ideally, instead of gcc_attribute, the grammar would allow
gcc_attribute_list here (as always with GCC attributes), but that would
have introduced a reduce/reduce conflict, due to the attributes in the
middle of labeled_statement.
diffstat:
usr.bin/xlint/lint1/cgram.y | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diffs (28 lines):
diff -r 4fc1b12ce985 -r 02952e1b8665 usr.bin/xlint/lint1/cgram.y
--- a/usr.bin/xlint/lint1/cgram.y Fri Apr 29 06:59:29 2022 +0000
+++ b/usr.bin/xlint/lint1/cgram.y Fri Apr 29 07:02:40 2022 +0000
@@ -1,5 +1,5 @@
%{
-/* $NetBSD: cgram.y,v 1.404 2022/04/29 06:40:51 rillig Exp $ */
+/* $NetBSD: cgram.y,v 1.405 2022/04/29 07:02:40 rillig 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.404 2022/04/29 06:40:51 rillig Exp $");
+__RCSID("$NetBSD: cgram.y,v 1.405 2022/04/29 07:02:40 rillig Exp $");
#endif
#include <limits.h>
@@ -1643,7 +1643,7 @@
;
non_expr_statement: /* helper for C99 6.8 */
- type_attribute T_SEMI
+ gcc_attribute /* ((__fallthrough__)) */ T_SEMI
| labeled_statement
| compound_statement
| selection_statement
Home |
Main Index |
Thread Index |
Old Index