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: merge duplicate code in declarations
details: https://anonhg.NetBSD.org/src/rev/247c4c26ed98
branches: trunk
changeset: 984663:247c4c26ed98
user: rillig <rillig%NetBSD.org@localhost>
date: Thu Jul 15 18:18:15 2021 +0000
description:
lint: merge duplicate code in declarations
No functional change, code coverage outside cgram.y stays the same.
diffstat:
usr.bin/xlint/lint1/cgram.y | 26 +++-----------------------
1 files changed, 3 insertions(+), 23 deletions(-)
diffs (48 lines):
diff -r 8afbe1fd8fba -r 247c4c26ed98 usr.bin/xlint/lint1/cgram.y
--- a/usr.bin/xlint/lint1/cgram.y Thu Jul 15 18:13:25 2021 +0000
+++ b/usr.bin/xlint/lint1/cgram.y Thu Jul 15 18:18:15 2021 +0000
@@ -1,5 +1,5 @@
%{
-/* $NetBSD: cgram.y,v 1.326 2021/07/15 18:13:25 rillig Exp $ */
+/* $NetBSD: cgram.y,v 1.327 2021/07/15 18:18:15 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.326 2021/07/15 18:13:25 rillig Exp $");
+__RCSID("$NetBSD: cgram.y,v 1.327 2021/07/15 18:18:15 rillig Exp $");
#endif
#include <limits.h>
@@ -1912,27 +1912,7 @@
warning(1);
}
}
- | begin_type_declmods end_type T_SEMI {
- if (dcs->d_scl == TYPEDEF) {
- /* typedef declares no type name */
- warning(72);
- } else {
- /* empty declaration */
- warning(2);
- }
- }
- | begin_type_declmods end_type notype_init_declarators T_SEMI
- | begin_type_declaration_specifiers end_type T_SEMI {
- if (dcs->d_scl == TYPEDEF) {
- /* typedef declares no type name */
- warning(72);
- } else if (!dcs->d_nonempty_decl) {
- /* empty declaration */
- warning(2);
- }
- }
- | begin_type_declaration_specifiers end_type
- type_init_declarators T_SEMI
+ | declaration
| error T_SEMI {
global_clean_up();
}
Home |
Main Index |
Thread Index |
Old Index