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: rename attron to in_gcc_attribute
details: https://anonhg.NetBSD.org/src/rev/7deb445d48e9
branches: trunk
changeset: 1026288:7deb445d48e9
user: rillig <rillig%NetBSD.org@localhost>
date: Tue Nov 16 17:41:23 2021 +0000
description:
lint: rename attron to in_gcc_attribute
No functional change.
diffstat:
tests/usr.bin/xlint/lint1/expr_precedence.c | 4 ++--
usr.bin/xlint/lint1/cgram.y | 8 ++++----
usr.bin/xlint/lint1/externs1.h | 4 ++--
usr.bin/xlint/lint1/func.c | 8 ++++----
usr.bin/xlint/lint1/lex.c | 11 +++++------
5 files changed, 17 insertions(+), 18 deletions(-)
diffs (137 lines):
diff -r 23a3957c0b48 -r 7deb445d48e9 tests/usr.bin/xlint/lint1/expr_precedence.c
--- a/tests/usr.bin/xlint/lint1/expr_precedence.c Tue Nov 16 16:57:15 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/expr_precedence.c Tue Nov 16 17:41:23 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: expr_precedence.c,v 1.7 2021/07/26 18:10:14 rillig Exp $ */
+/* $NetBSD: expr_precedence.c,v 1.8 2021/11/16 17:41:23 rillig Exp $ */
# 3 "expr_precedence.c"
/*
@@ -28,7 +28,7 @@
* __attribute__ are constant expressions, looking up global variables
* would not make sense. Therefore, 'var' is undefined.
*
- * See lex.c, function 'search', keyword 'attron'.
+ * See lex.c, function 'search', keyword 'in_gcc_attribute'.
*/
/* expect+2: error: 'var' undefined [99] */
/* expect+1: syntax error '=' [249] */
diff -r 23a3957c0b48 -r 7deb445d48e9 usr.bin/xlint/lint1/cgram.y
--- a/usr.bin/xlint/lint1/cgram.y Tue Nov 16 16:57:15 2021 +0000
+++ b/usr.bin/xlint/lint1/cgram.y Tue Nov 16 17:41:23 2021 +0000
@@ -1,5 +1,5 @@
%{
-/* $NetBSD: cgram.y,v 1.367 2021/09/26 01:28:43 rillig Exp $ */
+/* $NetBSD: cgram.y,v 1.368 2021/11/16 17:41:23 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.367 2021/09/26 01:28:43 rillig Exp $");
+__RCSID("$NetBSD: cgram.y,v 1.368 2021/11/16 17:41:23 rillig Exp $");
#endif
#include <limits.h>
@@ -2032,9 +2032,9 @@
gcc_attribute:
T_ATTRIBUTE T_LPAREN T_LPAREN {
- attron = true;
+ in_gcc_attribute = true;
} gcc_attribute_spec_list {
- attron = false;
+ in_gcc_attribute = false;
} T_RPAREN T_RPAREN
;
diff -r 23a3957c0b48 -r 7deb445d48e9 usr.bin/xlint/lint1/externs1.h
--- a/usr.bin/xlint/lint1/externs1.h Tue Nov 16 16:57:15 2021 +0000
+++ b/usr.bin/xlint/lint1/externs1.h Tue Nov 16 17:41:23 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: externs1.h,v 1.138 2021/08/31 17:51:30 rillig Exp $ */
+/* $NetBSD: externs1.h,v 1.139 2021/11/16 17:41:23 rillig Exp $ */
/*
* Copyright (c) 1994, 1995 Jochen Pohl
@@ -70,7 +70,7 @@
/*
* scan.l
*/
-extern bool attron;
+extern bool in_gcc_attribute;
extern pos_t curr_pos;
extern pos_t csrc_pos;
extern bool in_system_header;
diff -r 23a3957c0b48 -r 7deb445d48e9 usr.bin/xlint/lint1/func.c
--- a/usr.bin/xlint/lint1/func.c Tue Nov 16 16:57:15 2021 +0000
+++ b/usr.bin/xlint/lint1/func.c Tue Nov 16 17:41:23 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: func.c,v 1.124 2021/09/04 12:37:46 rillig Exp $ */
+/* $NetBSD: func.c,v 1.125 2021/11/16 17:41:23 rillig Exp $ */
/*
* Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
#include <sys/cdefs.h>
#if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: func.c,v 1.124 2021/09/04 12:37:46 rillig Exp $");
+__RCSID("$NetBSD: func.c,v 1.125 2021/11/16 17:41:23 rillig Exp $");
#endif
#include <stdlib.h>
@@ -1157,9 +1157,9 @@
/*
* Needed for BSD yacc in case of parse errors; GNU Bison 3.0.4 is
- * fine. See gcc_attribute.c, function_with_unknown_attribute.
+ * fine. See test gcc_attribute.c, function_with_unknown_attribute.
*/
- attron = false;
+ in_gcc_attribute = false;
}
/*
diff -r 23a3957c0b48 -r 7deb445d48e9 usr.bin/xlint/lint1/lex.c
--- a/usr.bin/xlint/lint1/lex.c Tue Nov 16 16:57:15 2021 +0000
+++ b/usr.bin/xlint/lint1/lex.c Tue Nov 16 17:41:23 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: lex.c,v 1.85 2021/11/01 19:10:07 rillig Exp $ */
+/* $NetBSD: lex.c,v 1.86 2021/11/16 17:41:23 rillig 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.85 2021/11/01 19:10:07 rillig Exp $");
+__RCSID("$NetBSD: lex.c,v 1.86 2021/11/16 17:41:23 rillig Exp $");
#endif
#include <ctype.h>
@@ -64,8 +64,7 @@
*/
pos_t csrc_pos = { "", 1, 0 };
-/* Are we parsing a gcc attribute? */
-bool attron;
+bool in_gcc_attribute; /* Are we parsing a gcc attribute? */
bool in_system_header = false;
@@ -473,9 +472,9 @@
if (kw != NULL && !kw->kw_attr)
return sym;
- if (kw != NULL && attron)
+ if (kw != NULL && in_gcc_attribute)
return sym;
- if (kw == NULL && !attron && sym->s_kind == symtyp)
+ if (kw == NULL && !in_gcc_attribute && sym->s_kind == symtyp)
return sym;
}
Home |
Main Index |
Thread Index |
Old Index