Module Name: src Committed By: rillig Date: Sun Apr 18 08:53:35 UTC 2021
Modified Files: src/usr.bin/xlint/lint1: ckgetopt.c Log Message: lint: migrate the getopt check to warning_at To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/usr.bin/xlint/lint1/ckgetopt.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/usr.bin/xlint/lint1/ckgetopt.c diff -u src/usr.bin/xlint/lint1/ckgetopt.c:1.7 src/usr.bin/xlint/lint1/ckgetopt.c:1.8 --- src/usr.bin/xlint/lint1/ckgetopt.c:1.7 Mon Mar 22 19:25:08 2021 +++ src/usr.bin/xlint/lint1/ckgetopt.c Sun Apr 18 08:53:35 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: ckgetopt.c,v 1.7 2021/03/22 19:25:08 rillig Exp $ */ +/* $NetBSD: ckgetopt.c,v 1.8 2021/04/18 08:53:35 rillig Exp $ */ /*- * Copyright (c) 2021 The NetBSD Foundation, Inc. @@ -35,7 +35,7 @@ #include <sys/cdefs.h> #if defined(__RCSID) && !defined(lint) -__RCSID("$NetBSD: ckgetopt.c,v 1.7 2021/03/22 19:25:08 rillig Exp $"); +__RCSID("$NetBSD: ckgetopt.c,v 1.8 2021/04/18 08:53:35 rillig Exp $"); #endif #include <stdbool.h> @@ -134,11 +134,8 @@ check_unhandled_option(void) if (*opt == ' ' || *opt == ':') continue; - pos_t prev_pos = curr_pos; - curr_pos = ck.options_pos; /* option '%c' should be handled in the switch */ - warning(338, *opt); - curr_pos = prev_pos; + warning_at(338, ck.options_pos, *opt); } }