Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/xlint/lint1 lint: allow message IDs to be only speci...



details:   https://anonhg.NetBSD.org/src/rev/0918a85f677f
branches:  trunk
changeset: 368280:0918a85f677f
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sat Jul 02 11:17:54 2022 +0000

description:
lint: allow message IDs to be only specified in decimal

The message IDs are communicated in decimal everywhere, there's no point
in passing '-X 0x00000084' instead of the clearer '-X 132'.

diffstat:

 usr.bin/xlint/lint1/err.c |  8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)

diffs (31 lines):

diff -r 13e502f891e3 -r 0918a85f677f usr.bin/xlint/lint1/err.c
--- a/usr.bin/xlint/lint1/err.c Sat Jul 02 10:47:29 2022 +0000
+++ b/usr.bin/xlint/lint1/err.c Sat Jul 02 11:17:54 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: err.c,v 1.179 2022/07/01 21:48:05 rillig Exp $ */
+/*     $NetBSD: err.c,v 1.180 2022/07/02 11:17:54 rillig Exp $ */
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,10 +37,9 @@
 
 #include <sys/cdefs.h>
 #if defined(__RCSID)
-__RCSID("$NetBSD: err.c,v 1.179 2022/07/01 21:48:05 rillig Exp $");
+__RCSID("$NetBSD: err.c,v 1.180 2022/07/02 11:17:54 rillig Exp $");
 #endif
 
-#include <errno.h>
 #include <limits.h>
 #include <stdarg.h>
 #include <stdlib.h>
@@ -423,8 +422,7 @@
        unsigned long id;
 
        for (ptr = strtok(ids, ","); ptr != NULL; ptr = strtok(NULL, ",")) {
-               errno = 0;
-               id = strtoul(ptr, &end, 0);
+               id = strtoul(ptr, &end, 10);
                if (*end != '\0' || ptr == end ||
                    id >= sizeof(msgs) / sizeof(msgs[0]))
                        errx(1, "invalid error message id '%s'", ptr);



Home | Main Index | Thread Index | Old Index