| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: decl.c,v 1.95 2021/01/01 11:51:15 rillig Exp $ */ | | 1 | /* $NetBSD: decl.c,v 1.96 2021/01/01 13:43:34 kre Exp $ */ |
2 | | | 2 | |
3 | /* | | 3 | /* |
4 | * Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved. | | 4 | * Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved. |
5 | * Copyright (c) 1994, 1995 Jochen Pohl | | 5 | * Copyright (c) 1994, 1995 Jochen Pohl |
6 | * All Rights Reserved. | | 6 | * All Rights Reserved. |
7 | * | | 7 | * |
8 | * Redistribution and use in source and binary forms, with or without | | 8 | * Redistribution and use in source and binary forms, with or without |
9 | * modification, are permitted provided that the following conditions | | 9 | * modification, are permitted provided that the following conditions |
10 | * are met: | | 10 | * are met: |
11 | * 1. Redistributions of source code must retain the above copyright | | 11 | * 1. Redistributions of source code must retain the above copyright |
12 | * notice, this list of conditions and the following disclaimer. | | 12 | * notice, this list of conditions and the following disclaimer. |
13 | * 2. Redistributions in binary form must reproduce the above copyright | | 13 | * 2. Redistributions in binary form must reproduce the above copyright |
14 | * notice, this list of conditions and the following disclaimer in the | | 14 | * notice, this list of conditions and the following disclaimer in the |
| @@ -28,27 +28,27 @@ | | | @@ -28,27 +28,27 @@ |
28 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | | 28 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
29 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | | 29 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
30 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | | 30 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
31 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | | 31 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
32 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | | 32 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
33 | */ | | 33 | */ |
34 | | | 34 | |
35 | #if HAVE_NBTOOL_CONFIG_H | | 35 | #if HAVE_NBTOOL_CONFIG_H |
36 | #include "nbtool_config.h" | | 36 | #include "nbtool_config.h" |
37 | #endif | | 37 | #endif |
38 | | | 38 | |
39 | #include <sys/cdefs.h> | | 39 | #include <sys/cdefs.h> |
40 | #if defined(__RCSID) && !defined(lint) | | 40 | #if defined(__RCSID) && !defined(lint) |
41 | __RCSID("$NetBSD: decl.c,v 1.95 2021/01/01 11:51:15 rillig Exp $"); | | 41 | __RCSID("$NetBSD: decl.c,v 1.96 2021/01/01 13:43:34 kre Exp $"); |
42 | #endif | | 42 | #endif |
43 | | | 43 | |
44 | #include <sys/param.h> | | 44 | #include <sys/param.h> |
45 | #include <limits.h> | | 45 | #include <limits.h> |
46 | #include <stdlib.h> | | 46 | #include <stdlib.h> |
47 | #include <string.h> | | 47 | #include <string.h> |
48 | | | 48 | |
49 | #include "lint1.h" | | 49 | #include "lint1.h" |
50 | | | 50 | |
51 | const char *unnamed = "<unnamed>"; | | 51 | const char *unnamed = "<unnamed>"; |
52 | | | 52 | |
53 | /* shared type structures for arithmtic types and void */ | | 53 | /* shared type structures for arithmtic types and void */ |
54 | static type_t *typetab; | | 54 | static type_t *typetab; |
| @@ -606,26 +606,27 @@ popdecl(void) | | | @@ -606,26 +606,27 @@ popdecl(void) |
606 | dinfo_t *di; | | 606 | dinfo_t *di; |
607 | | | 607 | |
608 | if (dflag) | | 608 | if (dflag) |
609 | (void)printf("popdecl(%p %d)\n", dcs, (int)dcs->d_ctx); | | 609 | (void)printf("popdecl(%p %d)\n", dcs, (int)dcs->d_ctx); |
610 | | | 610 | |
611 | lint_assert(dcs->d_next != NULL); | | 611 | lint_assert(dcs->d_next != NULL); |
612 | di = dcs; | | 612 | di = dcs; |
613 | dcs = di->d_next; | | 613 | dcs = di->d_next; |
614 | switch (di->d_ctx) { | | 614 | switch (di->d_ctx) { |
615 | case EXTERN: | | 615 | case EXTERN: |
616 | /* there is nothing after external declarations */ | | 616 | /* there is nothing after external declarations */ |
617 | lint_assert(0); | | 617 | lint_assert(0); |
618 | /* NOTREACHED */ | | 618 | /* NOTREACHED */ |
| | | 619 | /* XXX gcc is stupid enough not to know that, hence: */ break; |
619 | case MOS: | | 620 | case MOS: |
620 | case MOU: | | 621 | case MOU: |
621 | case ENUMCON: | | 622 | case ENUMCON: |
622 | /* | | 623 | /* |
623 | * Symbols declared in (nested) structs or enums are | | 624 | * Symbols declared in (nested) structs or enums are |
624 | * part of the next level (they are removed from the | | 625 | * part of the next level (they are removed from the |
625 | * symbol table if the symbols of the outher level are | | 626 | * symbol table if the symbols of the outher level are |
626 | * removed). | | 627 | * removed). |
627 | */ | | 628 | */ |
628 | if ((*dcs->d_ldlsym = di->d_dlsyms) != NULL) | | 629 | if ((*dcs->d_ldlsym = di->d_dlsyms) != NULL) |
629 | dcs->d_ldlsym = di->d_ldlsym; | | 630 | dcs->d_ldlsym = di->d_ldlsym; |
630 | break; | | 631 | break; |
631 | case ARG: | | 632 | case ARG: |