| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: main1.c,v 1.74 2023/07/13 08:40:38 rillig Exp $ */ | | 1 | /* $NetBSD: main1.c,v 1.75 2023/07/29 06:44:44 rillig 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) | | 39 | #if defined(__RCSID) |
40 | __RCSID("$NetBSD: main1.c,v 1.74 2023/07/13 08:40:38 rillig Exp $"); | | 40 | __RCSID("$NetBSD: main1.c,v 1.75 2023/07/29 06:44:44 rillig Exp $"); |
41 | #endif | | 41 | #endif |
42 | | | 42 | |
43 | #include <sys/types.h> | | 43 | #include <sys/types.h> |
44 | #include <signal.h> | | 44 | #include <signal.h> |
45 | #include <stdio.h> | | 45 | #include <stdio.h> |
46 | #include <stdlib.h> | | 46 | #include <stdlib.h> |
47 | #include <string.h> | | 47 | #include <string.h> |
48 | #include <unistd.h> | | 48 | #include <unistd.h> |
49 | | | 49 | |
50 | #include "lint1.h" | | 50 | #include "lint1.h" |
51 | | | 51 | |
52 | int aflag; | | 52 | int aflag; |
53 | bool bflag; | | 53 | bool bflag; |
| @@ -251,31 +251,31 @@ main(int argc, char *argv[]) | | | @@ -251,31 +251,31 @@ main(int argc, char *argv[]) |
251 | (void)fclose(yyin); | | 251 | (void)fclose(yyin); |
252 | | | 252 | |
253 | /* Following warnings cannot be suppressed by LINTED */ | | 253 | /* Following warnings cannot be suppressed by LINTED */ |
254 | lwarn = LWARN_ALL; | | 254 | lwarn = LWARN_ALL; |
255 | debug_step("main lwarn = %d", lwarn); | | 255 | debug_step("main lwarn = %d", lwarn); |
256 | | | 256 | |
257 | check_global_symbols(); | | 257 | check_global_symbols(); |
258 | | | 258 | |
259 | outclose(); | | 259 | outclose(); |
260 | | | 260 | |
261 | return seen_error || (wflag && seen_warning) ? 1 : 0; | | 261 | return seen_error || (wflag && seen_warning) ? 1 : 0; |
262 | } | | 262 | } |
263 | | | 263 | |
264 | static void __attribute__((noreturn)) | | 264 | static void __dead |
265 | usage(void) | | 265 | usage(void) |
266 | { | | 266 | { |
267 | (void)fprintf(stderr, | | 267 | (void)fprintf(stderr, |
268 | "usage: %s [-abceghmprstuvwyzFPST] [-Alevel] [-ddirectory] " | | 268 | "usage: %s [-abceghmprstuvwyzFPST] [-Alevel] [-ddirectory] " |
269 | "[-R old=new]\n" | | 269 | "[-R old=new]\n" |
270 | " %*s [-X id,...] [-q id,...] src dest\n", | | 270 | " %*s [-X id,...] [-q id,...] src dest\n", |
271 | getprogname(), (int)strlen(getprogname()), ""); | | 271 | getprogname(), (int)strlen(getprogname()), ""); |
272 | exit(1); | | 272 | exit(1); |
273 | } | | 273 | } |
274 | | | 274 | |
275 | void __attribute__((noreturn)) | | 275 | void __dead |
276 | norecover(void) | | 276 | norecover(void) |
277 | { | | 277 | { |
278 | /* cannot recover from previous errors */ | | 278 | /* cannot recover from previous errors */ |
279 | error(224); | | 279 | error(224); |
280 | exit(1); | | 280 | exit(1); |
281 | } | | 281 | } |