| @@ -1,15 +1,15 @@ | | | @@ -1,15 +1,15 @@ |
1 | %{ | | 1 | %{ |
2 | /* $NetBSD: cgram.y,v 1.46 2009/10/02 19:01:13 christos Exp $ */ | | 2 | /* $NetBSD: cgram.y,v 1.47 2009/10/03 01:35:20 christos 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.46 2009/10/02 19:01:13 christos Exp $"); | | 38 | __RCSID("$NetBSD: cgram.y,v 1.47 2009/10/03 01:35:20 christos Exp $"); |
39 | #endif | | 39 | #endif |
40 | | | 40 | |
41 | #include <stdlib.h> | | 41 | #include <stdlib.h> |
42 | #include <string.h> | | 42 | #include <string.h> |
43 | #include <limits.h> | | 43 | #include <limits.h> |
44 | | | 44 | |
45 | #include "lint1.h" | | 45 | #include "lint1.h" |
46 | | | 46 | |
47 | extern char *yytext; | | 47 | extern char *yytext; |
48 | /* | | 48 | /* |
49 | * Contains the level of current declaration. 0 is extern. | | 49 | * Contains the level of current declaration. 0 is extern. |
50 | * Used for symbol table entries. | | 50 | * Used for symbol table entries. |
51 | */ | | 51 | */ |
| @@ -674,26 +674,27 @@ member_declaration: | | | @@ -674,26 +674,27 @@ member_declaration: |
674 | | error { | | 674 | | error { |
675 | symtyp = FVFT; | | 675 | symtyp = FVFT; |
676 | $$ = NULL; | | 676 | $$ = NULL; |
677 | } | | 677 | } |
678 | ; | | 678 | ; |
679 | | | 679 | |
680 | noclass_declspecs: | | 680 | noclass_declspecs: |
681 | clrtyp_typespec { | | 681 | clrtyp_typespec { |
682 | addtype($1); | | 682 | addtype($1); |
683 | } | | 683 | } |
684 | | noclass_declmods typespec { | | 684 | | noclass_declmods typespec { |
685 | addtype($2); | | 685 | addtype($2); |
686 | } | | 686 | } |
| | | 687 | | noclass_declspecs type_attribute |
687 | | noclass_declspecs T_QUAL { | | 688 | | noclass_declspecs T_QUAL { |
688 | addqual($2); | | 689 | addqual($2); |
689 | } | | 690 | } |
690 | | noclass_declspecs notype_typespec { | | 691 | | noclass_declspecs notype_typespec { |
691 | addtype($2); | | 692 | addtype($2); |
692 | } | | 693 | } |
693 | ; | | 694 | ; |
694 | | | 695 | |
695 | noclass_declmods: | | 696 | noclass_declmods: |
696 | clrtyp T_QUAL { | | 697 | clrtyp T_QUAL { |
697 | addqual($2); | | 698 | addqual($2); |
698 | } | | 699 | } |
699 | | noclass_declmods T_QUAL { | | 700 | | noclass_declmods T_QUAL { |