Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/tests/usr.bin/xlint/lint1 tests/lint: demonstrate parse erro...
details: https://anonhg.NetBSD.org/src/rev/c10fe0302344
branches: trunk
changeset: 984526:c10fe0302344
user: rillig <rillig%NetBSD.org@localhost>
date: Sat Jul 10 22:34:02 2021 +0000
description:
tests/lint: demonstrate parse error for __attribute__ member
diffstat:
tests/usr.bin/xlint/lint1/decl_struct_member.c | 11 +++++++++--
tests/usr.bin/xlint/lint1/decl_struct_member.exp | 9 +++++----
2 files changed, 14 insertions(+), 6 deletions(-)
diffs (38 lines):
diff -r 039291048840 -r c10fe0302344 tests/usr.bin/xlint/lint1/decl_struct_member.c
--- a/tests/usr.bin/xlint/lint1/decl_struct_member.c Sat Jul 10 21:44:51 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/decl_struct_member.c Sat Jul 10 22:34:02 2021 +0000
@@ -1,12 +1,19 @@
-/* $NetBSD: decl_struct_member.c,v 1.3 2021/07/10 17:35:54 rillig Exp $ */
+/* $NetBSD: decl_struct_member.c,v 1.4 2021/07/10 22:34:02 rillig Exp $ */
# 3 "decl_struct_member.c"
+struct multi_attributes {
+ __attribute__((deprecated))
+ /* expect+1: error: syntax error '__attribute__' [249] */
+ __attribute__((deprecated))
+ __attribute__((deprecated))
+ int deprecated;
+};
+
/*
* Before cgram.y 1.228 from 2021-06-19, lint ran into an assertion failure:
*
* "is_struct_or_union(dcs->d_type->t_tspec)" at cgram.y:846
*/
-
struct {
char; /* expect: syntax error 'unnamed member' */
};
diff -r 039291048840 -r c10fe0302344 tests/usr.bin/xlint/lint1/decl_struct_member.exp
--- a/tests/usr.bin/xlint/lint1/decl_struct_member.exp Sat Jul 10 21:44:51 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/decl_struct_member.exp Sat Jul 10 22:34:02 2021 +0000
@@ -1,4 +1,5 @@
-decl_struct_member.c(11): error: syntax error 'unnamed member' [249]
-decl_struct_member.c(18): error: syntax error '0' [249]
-decl_struct_member.c(19): warning: syntax requires ';' after last struct/union member [66]
-decl_struct_member.c(26): error: cannot recover from previous errors [224]
+decl_struct_member.c(7): error: syntax error '__attribute__' [249]
+decl_struct_member.c(18): error: syntax error 'unnamed member' [249]
+decl_struct_member.c(25): error: syntax error '0' [249]
+decl_struct_member.c(26): warning: syntax requires ';' after last struct/union member [66]
+decl_struct_member.c(33): error: cannot recover from previous errors [224]
Home |
Main Index |
Thread Index |
Old Index