| @@ -1,15 +1,15 @@ | | | @@ -1,15 +1,15 @@ |
1 | %{ | | 1 | %{ |
2 | /* $NetBSD: cgram.y,v 1.274 2021/07/08 19:08:03 rillig Exp $ */ | | 2 | /* $NetBSD: cgram.y,v 1.275 2021/07/09 06:37:11 rillig Exp $ */ |
3 | | | 3 | |
4 | /* | | 4 | /* |
5 | * Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved. | | 5 | * Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved. |
6 | * Copyright (c) 1994, 1995 Jochen Pohl | | 6 | * Copyright (c) 1994, 1995 Jochen Pohl |
7 | * All Rights Reserved. | | 7 | * All Rights Reserved. |
8 | * | | 8 | * |
9 | * Redistribution and use in source and binary forms, with or without | | 9 | * Redistribution and use in source and binary forms, with or without |
10 | * modification, are permitted provided that the following conditions | | 10 | * modification, are permitted provided that the following conditions |
11 | * are met: | | 11 | * are met: |
12 | * 1. Redistributions of source code must retain the above copyright | | 12 | * 1. Redistributions of source code must retain the above copyright |
13 | * notice, this list of conditions and the following disclaimer. | | 13 | * notice, this list of conditions and the following disclaimer. |
14 | * 2. Redistributions in binary form must reproduce the above copyright | | 14 | * 2. Redistributions in binary form must reproduce the above copyright |
15 | * notice, this list of conditions and the following disclaimer in the | | 15 | * notice, this list of conditions and the following disclaimer in the |
| @@ -25,27 +25,27 @@ | | | @@ -25,27 +25,27 @@ |
25 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | | 25 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
26 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | | 26 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
27 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | | 27 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, |
28 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | | 28 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
29 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | | 29 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
30 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | | 30 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
31 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | | 31 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
32 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | | 32 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
33 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | | 33 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
34 | */ | | 34 | */ |
35 | | | 35 | |
36 | #include <sys/cdefs.h> | | 36 | #include <sys/cdefs.h> |
37 | #if defined(__RCSID) && !defined(lint) | | 37 | #if defined(__RCSID) && !defined(lint) |
38 | __RCSID("$NetBSD: cgram.y,v 1.274 2021/07/08 19:08:03 rillig Exp $"); | | 38 | __RCSID("$NetBSD: cgram.y,v 1.275 2021/07/09 06:37:11 rillig Exp $"); |
39 | #endif | | 39 | #endif |
40 | | | 40 | |
41 | #include <limits.h> | | 41 | #include <limits.h> |
42 | #include <stdlib.h> | | 42 | #include <stdlib.h> |
43 | #include <string.h> | | 43 | #include <string.h> |
44 | | | 44 | |
45 | #include "lint1.h" | | 45 | #include "lint1.h" |
46 | | | 46 | |
47 | extern char *yytext; | | 47 | extern char *yytext; |
48 | | | 48 | |
49 | /* | | 49 | /* |
50 | * Contains the level of current declaration, used for symbol table entries. | | 50 | * Contains the level of current declaration, used for symbol table entries. |
51 | * 0 is the top-level, > 0 is inside a function body. | | 51 | * 0 is the top-level, > 0 is inside a function body. |
| @@ -2002,29 +2002,29 @@ type_attribute: | | | @@ -2002,29 +2002,29 @@ type_attribute: |
2002 | gcc_attribute_list_opt: | | 2002 | gcc_attribute_list_opt: |
2003 | /* empty */ | | 2003 | /* empty */ |
2004 | | gcc_attribute_list | | 2004 | | gcc_attribute_list |
2005 | ; | | 2005 | ; |
2006 | | | 2006 | |
2007 | gcc_attribute_list: | | 2007 | gcc_attribute_list: |
2008 | gcc_attribute | | 2008 | gcc_attribute |
2009 | | gcc_attribute_list gcc_attribute | | 2009 | | gcc_attribute_list gcc_attribute |
2010 | ; | | 2010 | ; |
2011 | | | 2011 | |
2012 | /* https://gcc.gnu.org/onlinedocs/gcc/Attribute-Syntax.html */ | | 2012 | /* https://gcc.gnu.org/onlinedocs/gcc/Attribute-Syntax.html */ |
2013 | gcc_attribute: | | 2013 | gcc_attribute: |
2014 | T_ATTRIBUTE T_LPAREN T_LPAREN { | | 2014 | T_ATTRIBUTE T_LPAREN T_LPAREN { |
2015 | attron = true; | | 2015 | attron = true; |
2016 | } gcc_attribute_spec_list { | | 2016 | } gcc_attribute_spec_list { |
2017 | attron = false; | | 2017 | attron = false; |
2018 | } T_RPAREN T_RPAREN | | 2018 | } T_RPAREN T_RPAREN |
2019 | ; | | 2019 | ; |
2020 | | | 2020 | |
2021 | gcc_attribute_spec_list: | | 2021 | gcc_attribute_spec_list: |
2022 | gcc_attribute_spec | | 2022 | gcc_attribute_spec |
2023 | | gcc_attribute_spec_list T_COMMA gcc_attribute_spec | | 2023 | | gcc_attribute_spec_list T_COMMA gcc_attribute_spec |
2024 | ; | | 2024 | ; |
2025 | | | 2025 | |
2026 | gcc_attribute_spec: | | 2026 | gcc_attribute_spec: |
2027 | /* empty */ | | 2027 | /* empty */ |
2028 | | T_AT_ALWAYS_INLINE | | 2028 | | T_AT_ALWAYS_INLINE |
2029 | | T_AT_ALIAS T_LPAREN string T_RPAREN | | 2029 | | T_AT_ALIAS T_LPAREN string T_RPAREN |
2030 | | T_AT_ALIGNED T_LPAREN constant_expr T_RPAREN | | 2030 | | T_AT_ALIGNED T_LPAREN constant_expr T_RPAREN |