| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: main1.c,v 1.26 2016/12/24 17:43:45 christos Exp $ */ | | 1 | /* $NetBSD: main1.c,v 1.27 2018/12/23 19:09:03 christos Exp $ */ |
2 | | | 2 | |
3 | /* | | 3 | /* |
4 | * Copyright (c) 1994, 1995 Jochen Pohl | | 4 | * Copyright (c) 1994, 1995 Jochen Pohl |
5 | * All Rights Reserved. | | 5 | * All Rights Reserved. |
6 | * | | 6 | * |
7 | * Redistribution and use in source and binary forms, with or without | | 7 | * Redistribution and use in source and binary forms, with or without |
8 | * modification, are permitted provided that the following conditions | | 8 | * modification, are permitted provided that the following conditions |
9 | * are met: | | 9 | * are met: |
10 | * 1. Redistributions of source code must retain the above copyright | | 10 | * 1. Redistributions of source code must retain the above copyright |
11 | * notice, this list of conditions and the following disclaimer. | | 11 | * notice, this list of conditions and the following disclaimer. |
12 | * 2. Redistributions in binary form must reproduce the above copyright | | 12 | * 2. Redistributions in binary form must reproduce the above copyright |
13 | * notice, this list of conditions and the following disclaimer in the | | 13 | * notice, this list of conditions and the following disclaimer in the |
14 | * documentation and/or other materials provided with the distribution. | | 14 | * documentation and/or other materials provided with the distribution. |
| @@ -27,27 +27,27 @@ | | | @@ -27,27 +27,27 @@ |
27 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | | 27 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
28 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | | 28 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
29 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | | 29 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
30 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | | 30 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
31 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | | 31 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
32 | */ | | 32 | */ |
33 | | | 33 | |
34 | #if HAVE_NBTOOL_CONFIG_H | | 34 | #if HAVE_NBTOOL_CONFIG_H |
35 | #include "nbtool_config.h" | | 35 | #include "nbtool_config.h" |
36 | #endif | | 36 | #endif |
37 | | | 37 | |
38 | #include <sys/cdefs.h> | | 38 | #include <sys/cdefs.h> |
39 | #if defined(__RCSID) && !defined(lint) | | 39 | #if defined(__RCSID) && !defined(lint) |
40 | __RCSID("$NetBSD: main1.c,v 1.26 2016/12/24 17:43:45 christos Exp $"); | | 40 | __RCSID("$NetBSD: main1.c,v 1.27 2018/12/23 19:09:03 christos Exp $"); |
41 | #endif | | 41 | #endif |
42 | | | 42 | |
43 | #include <sys/types.h> | | 43 | #include <sys/types.h> |
44 | #include <stdio.h> | | 44 | #include <stdio.h> |
45 | #include <string.h> | | 45 | #include <string.h> |
46 | #include <stdlib.h> | | 46 | #include <stdlib.h> |
47 | #include <unistd.h> | | 47 | #include <unistd.h> |
48 | #include <errno.h> | | 48 | #include <errno.h> |
49 | #include <limits.h> | | 49 | #include <limits.h> |
50 | #include <signal.h> | | 50 | #include <signal.h> |
51 | | | 51 | |
52 | #include "lint1.h" | | 52 | #include "lint1.h" |
53 | | | 53 | |
| @@ -231,28 +231,30 @@ main(int argc, char *argv[]) | | | @@ -231,28 +231,30 @@ main(int argc, char *argv[]) |
231 | break; | | 231 | break; |
232 | } | | 232 | } |
233 | } | | 233 | } |
234 | argc -= optind; | | 234 | argc -= optind; |
235 | argv += optind; | | 235 | argv += optind; |
236 | | | 236 | |
237 | if (argc != 2) | | 237 | if (argc != 2) |
238 | usage(); | | 238 | usage(); |
239 | | | 239 | |
240 | | | 240 | |
241 | /* initialize output */ | | 241 | /* initialize output */ |
242 | outopen(argv[1]); | | 242 | outopen(argv[1]); |
243 | | | 243 | |
| | | 244 | #ifdef YYDEBUG |
244 | if (yflag) | | 245 | if (yflag) |
245 | yydebug = 1; | | 246 | yydebug = 1; |
| | | 247 | #endif |
246 | | | 248 | |
247 | (void)signal(SIGFPE, sigfpe); | | 249 | (void)signal(SIGFPE, sigfpe); |
248 | initmem(); | | 250 | initmem(); |
249 | initdecl(); | | 251 | initdecl(); |
250 | initscan(); | | 252 | initscan(); |
251 | initmtab(); | | 253 | initmtab(); |
252 | | | 254 | |
253 | if ((yyin = bltin()) == NULL) | | 255 | if ((yyin = bltin()) == NULL) |
254 | err(1, "cannot open builtins"); | | 256 | err(1, "cannot open builtins"); |
255 | yyparse(); | | 257 | yyparse(); |
256 | fclose(yyin); | | 258 | fclose(yyin); |
257 | | | 259 | |
258 | /* open the input file */ | | 260 | /* open the input file */ |