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: fix parsing of __attribute__ for m...
details: https://anonhg.NetBSD.org/src/rev/69ac3376e3b7
branches: trunk
changeset: 984528:69ac3376e3b7
user: rillig <rillig%NetBSD.org@localhost>
date: Sat Jul 10 22:46:02 2021 +0000
description:
lint: fix parsing of __attribute__ for member (since 2021-07-10)
Since cgram.y 1.280 from 2021-07-10, lint could not parse struct members
that have multiple __attribute__ in front of their type.
diffstat:
tests/usr.bin/xlint/lint1/decl_struct_member.c | 3 +--
tests/usr.bin/xlint/lint1/decl_struct_member.exp | 9 ++++-----
usr.bin/xlint/lint1/cgram.y | 8 ++++----
3 files changed, 9 insertions(+), 11 deletions(-)
diffs (64 lines):
diff -r 36087d5a0dc8 -r 69ac3376e3b7 tests/usr.bin/xlint/lint1/decl_struct_member.c
--- a/tests/usr.bin/xlint/lint1/decl_struct_member.c Sat Jul 10 22:39:56 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/decl_struct_member.c Sat Jul 10 22:46:02 2021 +0000
@@ -1,9 +1,8 @@
-/* $NetBSD: decl_struct_member.c,v 1.4 2021/07/10 22:34:02 rillig Exp $ */
+/* $NetBSD: decl_struct_member.c,v 1.5 2021/07/10 22:46: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;
diff -r 36087d5a0dc8 -r 69ac3376e3b7 tests/usr.bin/xlint/lint1/decl_struct_member.exp
--- a/tests/usr.bin/xlint/lint1/decl_struct_member.exp Sat Jul 10 22:39:56 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/decl_struct_member.exp Sat Jul 10 22:46:02 2021 +0000
@@ -1,5 +1,4 @@
-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]
+decl_struct_member.c(17): error: syntax error 'unnamed member' [249]
+decl_struct_member.c(24): error: syntax error '0' [249]
+decl_struct_member.c(25): warning: syntax requires ';' after last struct/union member [66]
+decl_struct_member.c(32): error: cannot recover from previous errors [224]
diff -r 36087d5a0dc8 -r 69ac3376e3b7 usr.bin/xlint/lint1/cgram.y
--- a/usr.bin/xlint/lint1/cgram.y Sat Jul 10 22:39:56 2021 +0000
+++ b/usr.bin/xlint/lint1/cgram.y Sat Jul 10 22:46:02 2021 +0000
@@ -1,5 +1,5 @@
%{
-/* $NetBSD: cgram.y,v 1.304 2021/07/10 21:44:51 rillig Exp $ */
+/* $NetBSD: cgram.y,v 1.305 2021/07/10 22:46:02 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.304 2021/07/10 21:44:51 rillig Exp $");
+__RCSID("$NetBSD: cgram.y,v 1.305 2021/07/10 22:46:02 rillig Exp $");
#endif
#include <limits.h>
@@ -124,7 +124,7 @@
%}
-%expect 136
+%expect 131
%union {
val_t *y_val;
@@ -715,7 +715,7 @@
noclass_declspecs:
noclass_declspecs_postfix
- | type_attribute noclass_declspecs_postfix
+ | type_attribute noclass_declspecs
;
noclass_declspecs_postfix:
Home |
Main Index |
Thread Index |
Old Index