CVS commit: src/usr.bin/xlint/xlint
Module Name:src Committed By: christos Date: Sun Nov 28 02:54:26 UTC 2021 Modified Files: src/usr.bin/xlint/xlint: xlint.c Log Message: remove extra line To generate a diff of this commit: cvs rdiff -u -r1.85 -r1.86 src/usr.bin/xlint/xlint/xlint.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/xlint/xlint.c diff -u src/usr.bin/xlint/xlint/xlint.c:1.85 src/usr.bin/xlint/xlint/xlint.c:1.86 --- src/usr.bin/xlint/xlint/xlint.c:1.85 Sat Nov 27 21:07:02 2021 +++ src/usr.bin/xlint/xlint/xlint.c Sat Nov 27 21:54:26 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: xlint.c,v 1.85 2021/11/28 02:07:02 christos Exp $ */ +/* $NetBSD: xlint.c,v 1.86 2021/11/28 02:54:26 christos Exp $ */ /* * Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved. @@ -38,7 +38,7 @@ #include #if defined(__RCSID) && !defined(lint) -__RCSID("$NetBSD: xlint.c,v 1.85 2021/11/28 02:07:02 christos Exp $"); +__RCSID("$NetBSD: xlint.c,v 1.86 2021/11/28 02:54:26 christos Exp $"); #endif #include @@ -487,8 +487,6 @@ main(int argc, char *argv[]) case 'C': if (Cflag) usage("%c flag already specified", 'C'); - usage("%c and %s flags cannot be specified " - "together", 'C', "o or i"); if (oflag || iflag) usage("%c and %s flags cannot be specified " "together", 'C', "o or i");
CVS commit: src/usr.bin/xlint/xlint
Module Name:src Committed By: christos Date: Sun Nov 28 02:54:26 UTC 2021 Modified Files: src/usr.bin/xlint/xlint: xlint.c Log Message: remove extra line To generate a diff of this commit: cvs rdiff -u -r1.85 -r1.86 src/usr.bin/xlint/xlint/xlint.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/usr.bin/xlint/xlint
Module Name:src Committed By: christos Date: Sun Nov 28 02:07:02 UTC 2021 Modified Files: src/usr.bin/xlint/xlint: xlint.c Log Message: Explain the usage errors. To generate a diff of this commit: cvs rdiff -u -r1.84 -r1.85 src/usr.bin/xlint/xlint/xlint.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/xlint/xlint.c diff -u src/usr.bin/xlint/xlint/xlint.c:1.84 src/usr.bin/xlint/xlint/xlint.c:1.85 --- src/usr.bin/xlint/xlint/xlint.c:1.84 Sun Nov 21 05:39:47 2021 +++ src/usr.bin/xlint/xlint/xlint.c Sat Nov 27 21:07:02 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: xlint.c,v 1.84 2021/11/21 10:39:47 rillig Exp $ */ +/* $NetBSD: xlint.c,v 1.85 2021/11/28 02:07:02 christos Exp $ */ /* * Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved. @@ -38,7 +38,7 @@ #include #if defined(__RCSID) && !defined(lint) -__RCSID("$NetBSD: xlint.c,v 1.84 2021/11/21 10:39:47 rillig Exp $"); +__RCSID("$NetBSD: xlint.c,v 1.85 2021/11/28 02:07:02 christos Exp $"); #endif #include @@ -46,6 +46,7 @@ __RCSID("$NetBSD: xlint.c,v 1.84 2021/11 #include #include #include +#include #include #include #include @@ -299,13 +300,20 @@ lbasename(const char *strg, int delim) return *cp1 == '\0' ? cp2 : cp1; } -static void __attribute__((noreturn)) -usage(void) +static void __attribute__((__noreturn__, __format__(__printf__, 1, 2))) +usage(const char *fmt, ...) { const char *name; int indent; + va_list ap; name = getprogname(); + fprintf(stderr, "%s: ", name); + va_start(ap, fmt); + vfprintf(stderr, fmt, ap); + va_end(ap); + fprintf(stderr, "\n"); + indent = (int)(strlen("usage: ") + strlen(name)); (void)fprintf(stderr, "usage: %s [-abceghprvwxzHFST] [-s|-t] [-i|-nu]\n" @@ -412,7 +420,8 @@ main(int argc, char *argv[]) case 'i': if (Cflag) -usage(); +usage("%c and %s flags cannot be specified " +"together", 'C', "i"); iflag = true; break; @@ -430,7 +439,8 @@ main(int argc, char *argv[]) case 's': if (tflag) -usage(); +usage("%c and %s flags cannot be specified " +"together", 's', "t"); list_clear(&cpp.lcflags); list_add(&cpp.lcflags, "-trigraphs"); list_add(&cpp.lcflags, "-Wtrigraphs"); @@ -443,7 +453,8 @@ main(int argc, char *argv[]) case 'S': if (tflag) -usage(); +usage("%c and %s flags cannot be specified " +"together", 'S', "t"); pass_flag_to_lint1(c); break; @@ -455,7 +466,8 @@ main(int argc, char *argv[]) #if !HAVE_NBTOOL_CONFIG_H case 't': if (sflag) -usage(); +usage("%c and %s flags cannot be specified " +"together", 's', "t"); tflag = true; list_clear(&cpp.lcflags); list_add(&cpp.lcflags, "-traditional"); @@ -473,8 +485,13 @@ main(int argc, char *argv[]) break; case 'C': - if (Cflag || oflag || iflag) -usage(); + if (Cflag) +usage("%c flag already specified", 'C'); + usage("%c and %s flags cannot be specified " + "together", 'C', "o or i"); + if (oflag || iflag) +usage("%c and %s flags cannot be specified " +"together", 'C', "o or i"); Cflag = true; pass_flag_to_lint2(c); pass_to_lint2(optarg); @@ -484,7 +501,7 @@ main(int argc, char *argv[]) case 'd': if (dflag) -usage(); +usage("%c flag already specified", 'd'); dflag = true; pass_to_cpp("-nostdinc"); pass_to_cpp("-isystem"); @@ -504,8 +521,11 @@ main(int argc, char *argv[]) break; case 'o': - if (Cflag || oflag) -usage(); + if (oflag) +usage("%c flag already specified", 'o'); + if (Cflag) +usage("%c and %s flags cannot be specified " +"together", 'C', "o"); oflag = true; outputfn = xstrdup(optarg); break; @@ -527,7 +547,7 @@ main(int argc, char *argv[]) break; default: - usage(); + usage("Unknown flag %c", c); /* NOTREACHED */ } } @@ -553,7 +573,7 @@ main(int argc, char *argv[]) else if (arg[1] == 'L') list = &libsrchpath; else { -usage(); +usage("Unknown argument %s", arg); /* NOTREACHED */ } @@ -563,7 +583,7 @@ main(int argc, char *argv[]) argc--; list_add(list, *++argv); } else -usage(); +usage("Missing argument for l or L"); } else { /* filename */ fname(arg); @@ -574,7 +594,7 @@ main(int argc, char *argv[]) } if (first) - usage(); + usage("Missing filename"); if (iflag) terminate(0);
CVS commit: src/usr.bin/xlint/xlint
Module Name:src Committed By: christos Date: Sun Nov 28 02:07:02 UTC 2021 Modified Files: src/usr.bin/xlint/xlint: xlint.c Log Message: Explain the usage errors. To generate a diff of this commit: cvs rdiff -u -r1.84 -r1.85 src/usr.bin/xlint/xlint/xlint.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sbin/cgdconfig
Module Name:src Committed By: christos Date: Sun Nov 28 02:01:30 UTC 2021 Modified Files: src/sbin/cgdconfig: Makefile Log Message: -lpthread to LDADD (fixes lint build) To generate a diff of this commit: cvs rdiff -u -r1.16 -r1.17 src/sbin/cgdconfig/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/cgdconfig/Makefile diff -u src/sbin/cgdconfig/Makefile:1.16 src/sbin/cgdconfig/Makefile:1.17 --- src/sbin/cgdconfig/Makefile:1.16 Mon Nov 22 09:34:35 2021 +++ src/sbin/cgdconfig/Makefile Sat Nov 27 21:01:30 2021 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.16 2021/11/22 14:34:35 nia Exp $ +# $NetBSD: Makefile,v 1.17 2021/11/28 02:01:30 christos Exp $ RUMPPRG=cgdconfig MAN= cgdconfig.8 @@ -31,7 +31,7 @@ CPPFLAGS+= -DHAVE_ARGON2 PROGDPLIBS+= argon2 ${ARGON2DIR}/lib/libargon2 -LDADD+= -pthread +LDADD+= -lpthread DPADD+= ${LIBPTHREAD} .endif
CVS commit: src/sbin/cgdconfig
Module Name:src Committed By: christos Date: Sun Nov 28 02:01:30 UTC 2021 Modified Files: src/sbin/cgdconfig: Makefile Log Message: -lpthread to LDADD (fixes lint build) To generate a diff of this commit: cvs rdiff -u -r1.16 -r1.17 src/sbin/cgdconfig/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/share/mk
Module Name:src Committed By: rillig Date: Sun Nov 28 00:21:12 UTC 2021 Modified Files: src/share/mk: sys.mk Log Message: sys.mk: fix duplicate character in character class of LINTFLAGS The character class contained two times U+0020, which makes one of them redundant, so remove the character class. PR toolchain/18248 already contained these two spaces. Apparently there is no need to support tabs in this place, otherwise someone would have noticed it in the 17 years since this pattern had been added in sys.mk 1.83 from 2004-01-27. No functional change. To generate a diff of this commit: cvs rdiff -u -r1.146 -r1.147 src/share/mk/sys.mk Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/share/mk/sys.mk diff -u src/share/mk/sys.mk:1.146 src/share/mk/sys.mk:1.147 --- src/share/mk/sys.mk:1.146 Tue Mar 23 22:02:44 2021 +++ src/share/mk/sys.mk Sun Nov 28 00:21:12 2021 @@ -1,4 +1,4 @@ -# $NetBSD: sys.mk,v 1.146 2021/03/23 22:02:44 christos Exp $ +# $NetBSD: sys.mk,v 1.147 2021/11/28 00:21:12 rillig Exp $ # @(#)sys.mk 8.2 (Berkeley) 3/21/94 # # This file contains the basic rules for make(1) and is read first @@ -139,7 +139,7 @@ YACC.y?= ${YACC} ${YFLAGS} rm -f ${.PREFIX}.o .c.ln: ${LINT} ${LINTFLAGS} \ - ${CPPFLAGS:C/-([IDU])[ ]*/-\1/Wg:M-[IDU]*} \ + ${CPPFLAGS:C/-([IDU]) */-\1/Wg:M-[IDU]*} \ -i ${.IMPSRC} # C++
CVS commit: src/share/mk
Module Name:src Committed By: rillig Date: Sun Nov 28 00:21:12 UTC 2021 Modified Files: src/share/mk: sys.mk Log Message: sys.mk: fix duplicate character in character class of LINTFLAGS The character class contained two times U+0020, which makes one of them redundant, so remove the character class. PR toolchain/18248 already contained these two spaces. Apparently there is no need to support tabs in this place, otherwise someone would have noticed it in the 17 years since this pattern had been added in sys.mk 1.83 from 2004-01-27. No functional change. To generate a diff of this commit: cvs rdiff -u -r1.146 -r1.147 src/share/mk/sys.mk Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/usr.bin/make
Module Name:src Committed By: rillig Date: Sun Nov 28 00:02:07 UTC 2021 Modified Files: src/usr.bin/make: job.c src/usr.bin/make/unit-tests: opt-debug-errors-jobs.exp Log Message: make: with the option -de in jobs mode, output expanded commands This helps tracking down the actual cause of build failures in build systems like NetBSD's build.sh that use highly abstracted commands that are mainly defined in terms of variables. To generate a diff of this commit: cvs rdiff -u -r1.436 -r1.437 src/usr.bin/make/job.c cvs rdiff -u -r1.3 -r1.4 \ src/usr.bin/make/unit-tests/opt-debug-errors-jobs.exp 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/make/job.c diff -u src/usr.bin/make/job.c:1.436 src/usr.bin/make/job.c:1.437 --- src/usr.bin/make/job.c:1.436 Sun Oct 24 18:45:46 2021 +++ src/usr.bin/make/job.c Sun Nov 28 00:02:07 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: job.c,v 1.436 2021/10/24 18:45:46 sjg Exp $ */ +/* $NetBSD: job.c,v 1.437 2021/11/28 00:02:07 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -142,7 +142,7 @@ #include "trace.h" /* "@(#)job.c 8.2 (Berkeley) 3/19/94" */ -MAKE_RCSID("$NetBSD: job.c,v 1.436 2021/10/24 18:45:46 sjg Exp $"); +MAKE_RCSID("$NetBSD: job.c,v 1.437 2021/11/28 00:02:07 rillig Exp $"); /* * A shell defines how the commands are run. All commands for a target are @@ -1068,10 +1068,20 @@ DebugFailedJob(const Job *job) if (!DEBUG(ERROR)) return; - debug_printf("\n*** Failed target: %s\n*** Failed commands:\n", - job->node->name); - for (ln = job->node->commands.first; ln != NULL; ln = ln->next) - debug_printf("\t%s\n", (const char *)ln->datum); + debug_printf("\n"); + debug_printf("*** Failed target: %s\n", job->node->name); + debug_printf("*** Failed commands:\n"); + for (ln = job->node->commands.first; ln != NULL; ln = ln->next) { + const char *unexpanded = (const char *)ln->datum; + debug_printf("\t%s\n", unexpanded); + + if (strchr(unexpanded, '$') != NULL) { + char *expanded; + (void)Var_Subst((const char *)ln->datum, job->node, + VARE_WANTRES, &expanded); + debug_printf("\t=> %s\n", expanded); + } + } } static void Index: src/usr.bin/make/unit-tests/opt-debug-errors-jobs.exp diff -u src/usr.bin/make/unit-tests/opt-debug-errors-jobs.exp:1.3 src/usr.bin/make/unit-tests/opt-debug-errors-jobs.exp:1.4 --- src/usr.bin/make/unit-tests/opt-debug-errors-jobs.exp:1.3 Sat Nov 27 23:56:11 2021 +++ src/usr.bin/make/unit-tests/opt-debug-errors-jobs.exp Sun Nov 28 00:02:07 2021 @@ -24,6 +24,8 @@ line2 *** Failed target: fail-newline *** Failed commands: echo 'line1${.newline}line2'; false + => echo 'line1 +line2'; false *** [fail-newline] Error code 1 make: stopped in unit-tests @@ -49,6 +51,7 @@ make: stopped in unit-tests *** Failed target: fail-vars *** Failed commands: @${COMPILE_C} ${COMPILE_C_FLAGS} + => @false c-compiler flag1 -macro="several words" *** [fail-vars] Error code 1 make: stopped in unit-tests
CVS commit: src/usr.bin/make
Module Name:src Committed By: rillig Date: Sun Nov 28 00:02:07 UTC 2021 Modified Files: src/usr.bin/make: job.c src/usr.bin/make/unit-tests: opt-debug-errors-jobs.exp Log Message: make: with the option -de in jobs mode, output expanded commands This helps tracking down the actual cause of build failures in build systems like NetBSD's build.sh that use highly abstracted commands that are mainly defined in terms of variables. To generate a diff of this commit: cvs rdiff -u -r1.436 -r1.437 src/usr.bin/make/job.c cvs rdiff -u -r1.3 -r1.4 \ src/usr.bin/make/unit-tests/opt-debug-errors-jobs.exp Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/usr.bin/make/unit-tests
Module Name:src Committed By: rillig Date: Sat Nov 27 23:56:11 UTC 2021 Modified Files: src/usr.bin/make/unit-tests: opt-debug-errors-jobs.exp opt-debug-errors-jobs.mk Log Message: tests/make: demonstrate unhelpful debug log in case of errors The releng build job that runs lint fails. It outputs the usage message of lint, which doesn't include the failing option. After that, make outputs: *** Failed target: lint-cgdconfig *** Failed commands: ${LINT} ${LINTFLAGS} \ ${_LDFLAGS.${:Ucgdconfig}:C/-L[ ]*/-L/Wg:M-L*} \ ${LOBJS.${:Ucgdconfig}} ${_LDADD.${:Ucgdconfig}} Make doesn't output the expanded command, therefore the log doesn't show the offending option '-pthread' that leads to the usage message. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 \ src/usr.bin/make/unit-tests/opt-debug-errors-jobs.exp cvs rdiff -u -r1.1 -r1.2 src/usr.bin/make/unit-tests/opt-debug-errors-jobs.mk 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/make/unit-tests/opt-debug-errors-jobs.exp diff -u src/usr.bin/make/unit-tests/opt-debug-errors-jobs.exp:1.2 src/usr.bin/make/unit-tests/opt-debug-errors-jobs.exp:1.3 --- src/usr.bin/make/unit-tests/opt-debug-errors-jobs.exp:1.2 Tue Apr 27 16:23:21 2021 +++ src/usr.bin/make/unit-tests/opt-debug-errors-jobs.exp Sat Nov 27 23:56:11 2021 @@ -45,4 +45,11 @@ word1 word2 *** [fail-multiline-intention] Error code 1 make: stopped in unit-tests + +*** Failed target: fail-vars +*** Failed commands: + @${COMPILE_C} ${COMPILE_C_FLAGS} +*** [fail-vars] Error code 1 + +make: stopped in unit-tests exit status 1 Index: src/usr.bin/make/unit-tests/opt-debug-errors-jobs.mk diff -u src/usr.bin/make/unit-tests/opt-debug-errors-jobs.mk:1.1 src/usr.bin/make/unit-tests/opt-debug-errors-jobs.mk:1.2 --- src/usr.bin/make/unit-tests/opt-debug-errors-jobs.mk:1.1 Tue Apr 27 16:20:06 2021 +++ src/usr.bin/make/unit-tests/opt-debug-errors-jobs.mk Sat Nov 27 23:56:11 2021 @@ -1,4 +1,4 @@ -# $NetBSD: opt-debug-errors-jobs.mk,v 1.1 2021/04/27 16:20:06 rillig Exp $ +# $NetBSD: opt-debug-errors-jobs.mk,v 1.2 2021/11/27 23:56:11 rillig Exp $ # # Tests for the -de command line option, which adds debug logging for # failed commands and targets; since 2021-04-27 also in jobs mode. @@ -10,6 +10,7 @@ all: fail-escaped-space all: fail-newline all: fail-multiline all: fail-multiline-intention +all: fail-vars fail-spaces: echo '3 spaces'; false @@ -34,3 +35,14 @@ fail-multiline: fail-multiline-intention: echo 'word1' \ 'word2'; false + +# In makefiles that rely heavily on abstracted variables, it is not possible +# to determine the actual command from the unexpanded command alone. To help +# debugging these issues (for example in NetBSD's build.sh), output the +# expanded command as well whenever it differs from the unexpanded command. +# Since 2021-11-28. +COMPILE_C= false c-compiler +COMPILE_C_DEFS= macro="several words" +COMPILE_C_FLAGS=flag1 ${COMPILE_C_DEFS:@def@-${def}@} +fail-vars: + @${COMPILE_C} ${COMPILE_C_FLAGS}
CVS commit: src/usr.bin/make/unit-tests
Module Name:src Committed By: rillig Date: Sat Nov 27 23:56:11 UTC 2021 Modified Files: src/usr.bin/make/unit-tests: opt-debug-errors-jobs.exp opt-debug-errors-jobs.mk Log Message: tests/make: demonstrate unhelpful debug log in case of errors The releng build job that runs lint fails. It outputs the usage message of lint, which doesn't include the failing option. After that, make outputs: *** Failed target: lint-cgdconfig *** Failed commands: ${LINT} ${LINTFLAGS} \ ${_LDFLAGS.${:Ucgdconfig}:C/-L[ ]*/-L/Wg:M-L*} \ ${LOBJS.${:Ucgdconfig}} ${_LDADD.${:Ucgdconfig}} Make doesn't output the expanded command, therefore the log doesn't show the offending option '-pthread' that leads to the usage message. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 \ src/usr.bin/make/unit-tests/opt-debug-errors-jobs.exp cvs rdiff -u -r1.1 -r1.2 src/usr.bin/make/unit-tests/opt-debug-errors-jobs.mk Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/crypto/external/bsd/openssh/dist
Module Name:src Committed By: he Date: Sat Nov 27 23:22:25 UTC 2021 Modified Files: src/crypto/external/bsd/openssh/dist: sshd_config Log Message: Amend the comment about UsePAM; the ChallengeResponseAuthentication setting is deprecated, replaced by KbdInteractiveAuthentication, confirmed both by man page and code. To generate a diff of this commit: cvs rdiff -u -r1.26 -r1.27 src/crypto/external/bsd/openssh/dist/sshd_config Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/crypto/external/bsd/openssh/dist
Module Name:src Committed By: he Date: Sat Nov 27 23:22:25 UTC 2021 Modified Files: src/crypto/external/bsd/openssh/dist: sshd_config Log Message: Amend the comment about UsePAM; the ChallengeResponseAuthentication setting is deprecated, replaced by KbdInteractiveAuthentication, confirmed both by man page and code. To generate a diff of this commit: cvs rdiff -u -r1.26 -r1.27 src/crypto/external/bsd/openssh/dist/sshd_config Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/crypto/external/bsd/openssh/dist/sshd_config diff -u src/crypto/external/bsd/openssh/dist/sshd_config:1.26 src/crypto/external/bsd/openssh/dist/sshd_config:1.27 --- src/crypto/external/bsd/openssh/dist/sshd_config:1.26 Thu Sep 2 11:26:18 2021 +++ src/crypto/external/bsd/openssh/dist/sshd_config Sat Nov 27 23:22:25 2021 @@ -1,4 +1,4 @@ -# $NetBSD: sshd_config,v 1.26 2021/09/02 11:26:18 christos Exp $ +# $NetBSD: sshd_config,v 1.27 2021/11/27 23:22:25 he Exp $ # $OpenBSD: sshd_config,v 1.104 2021/07/02 05:11:21 dtucker Exp $ # This is the sshd server system-wide configuration file. See @@ -72,13 +72,13 @@ AuthorizedKeysFile .ssh/authorized_keys # Set this to 'yes' to enable PAM authentication, account processing, # and session processing. If this is enabled, PAM authentication will -# be allowed through the ChallengeResponseAuthentication and -# PasswordAuthentication. Depending on your PAM configuration, -# PAM authentication via ChallengeResponseAuthentication may bypass +# be allowed through the KbdInteractiveAuthentication and +# PasswordAuthentication settings. Depending on your PAM configuration, +# PAM authentication via KbdInteractiveAuthentication may bypass # the setting of "PermitRootLogin without-password". # If you just want the PAM account and session checks to run without # PAM authentication, then enable this but set PasswordAuthentication -# and ChallengeResponseAuthentication to 'no'. +# and KbdInteractiveAuthentication to 'no'. UsePAM yes #AllowAgentForwarding yes
CVS commit: src/usr.sbin
Module Name:src Committed By: rillig Date: Sat Nov 27 22:30:26 UTC 2021 Modified Files: src/usr.sbin/envstat: envstat.c src/usr.sbin/makemandb: apropos-utils.c src/usr.sbin/ndp: ndp.c src/usr.sbin/nfsd: nfsd.c src/usr.sbin/pstat: pstat.c src/usr.sbin/pwd_mkdb: pwd_mkdb.c src/usr.sbin/rtadvd: config.c src/usr.sbin/syslogd: sign.c sign.h syslogd.c syslogd.h tls.c Log Message: usr.sbin: remove unnecessary CONSTCOND, lint no longer needs it Since 2021-01-31, lint no longer requires a CONSTCOND comment in a do-while-0 statement since this is a common code pattern, especially in statement-like macros. sed -i -E 's,} while \(/\* ?CONSTCOND ?\*/ ?0\),} while (0),' */*.[ch] To generate a diff of this commit: cvs rdiff -u -r1.100 -r1.101 src/usr.sbin/envstat/envstat.c cvs rdiff -u -r1.47 -r1.48 src/usr.sbin/makemandb/apropos-utils.c cvs rdiff -u -r1.58 -r1.59 src/usr.sbin/ndp/ndp.c cvs rdiff -u -r1.73 -r1.74 src/usr.sbin/nfsd/nfsd.c cvs rdiff -u -r1.132 -r1.133 src/usr.sbin/pstat/pstat.c cvs rdiff -u -r1.58 -r1.59 src/usr.sbin/pwd_mkdb/pwd_mkdb.c cvs rdiff -u -r1.46 -r1.47 src/usr.sbin/rtadvd/config.c cvs rdiff -u -r1.7 -r1.8 src/usr.sbin/syslogd/sign.c cvs rdiff -u -r1.2 -r1.3 src/usr.sbin/syslogd/sign.h cvs rdiff -u -r1.137 -r1.138 src/usr.sbin/syslogd/syslogd.c cvs rdiff -u -r1.8 -r1.9 src/usr.sbin/syslogd/syslogd.h cvs rdiff -u -r1.18 -r1.19 src/usr.sbin/syslogd/tls.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/usr.sbin
Module Name:src Committed By: rillig Date: Sat Nov 27 22:30:26 UTC 2021 Modified Files: src/usr.sbin/envstat: envstat.c src/usr.sbin/makemandb: apropos-utils.c src/usr.sbin/ndp: ndp.c src/usr.sbin/nfsd: nfsd.c src/usr.sbin/pstat: pstat.c src/usr.sbin/pwd_mkdb: pwd_mkdb.c src/usr.sbin/rtadvd: config.c src/usr.sbin/syslogd: sign.c sign.h syslogd.c syslogd.h tls.c Log Message: usr.sbin: remove unnecessary CONSTCOND, lint no longer needs it Since 2021-01-31, lint no longer requires a CONSTCOND comment in a do-while-0 statement since this is a common code pattern, especially in statement-like macros. sed -i -E 's,} while \(/\* ?CONSTCOND ?\*/ ?0\),} while (0),' */*.[ch] To generate a diff of this commit: cvs rdiff -u -r1.100 -r1.101 src/usr.sbin/envstat/envstat.c cvs rdiff -u -r1.47 -r1.48 src/usr.sbin/makemandb/apropos-utils.c cvs rdiff -u -r1.58 -r1.59 src/usr.sbin/ndp/ndp.c cvs rdiff -u -r1.73 -r1.74 src/usr.sbin/nfsd/nfsd.c cvs rdiff -u -r1.132 -r1.133 src/usr.sbin/pstat/pstat.c cvs rdiff -u -r1.58 -r1.59 src/usr.sbin/pwd_mkdb/pwd_mkdb.c cvs rdiff -u -r1.46 -r1.47 src/usr.sbin/rtadvd/config.c cvs rdiff -u -r1.7 -r1.8 src/usr.sbin/syslogd/sign.c cvs rdiff -u -r1.2 -r1.3 src/usr.sbin/syslogd/sign.h cvs rdiff -u -r1.137 -r1.138 src/usr.sbin/syslogd/syslogd.c cvs rdiff -u -r1.8 -r1.9 src/usr.sbin/syslogd/syslogd.h cvs rdiff -u -r1.18 -r1.19 src/usr.sbin/syslogd/tls.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.sbin/envstat/envstat.c diff -u src/usr.sbin/envstat/envstat.c:1.100 src/usr.sbin/envstat/envstat.c:1.101 --- src/usr.sbin/envstat/envstat.c:1.100 Sat Nov 14 16:32:53 2020 +++ src/usr.sbin/envstat/envstat.c Sat Nov 27 22:30:25 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: envstat.c,v 1.100 2020/11/14 16:32:53 mlelstv Exp $ */ +/* $NetBSD: envstat.c,v 1.101 2021/11/27 22:30:25 rillig Exp $ */ /*- * Copyright (c) 2007, 2008 Juan Romero Pardines. @@ -27,7 +27,7 @@ #include #ifndef lint -__RCSID("$NetBSD: envstat.c,v 1.100 2020/11/14 16:32:53 mlelstv Exp $"); +__RCSID("$NetBSD: envstat.c,v 1.101 2021/11/27 22:30:25 rillig Exp $"); #endif /* not lint */ #include @@ -986,7 +986,7 @@ do {\ ilen = 9; \ } else \ ilen += 9; \ -} while (/* CONSTCOND */ 0) +} while (0) /* temperatures */ } else if (strcmp(sensor->type, "Temperature") == 0) { Index: src/usr.sbin/makemandb/apropos-utils.c diff -u src/usr.sbin/makemandb/apropos-utils.c:1.47 src/usr.sbin/makemandb/apropos-utils.c:1.48 --- src/usr.sbin/makemandb/apropos-utils.c:1.47 Sun Aug 18 09:14:30 2019 +++ src/usr.sbin/makemandb/apropos-utils.c Sat Nov 27 22:30:25 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: apropos-utils.c,v 1.47 2019/08/18 09:14:30 abhinav Exp $ */ +/* $NetBSD: apropos-utils.c,v 1.48 2021/11/27 22:30:25 rillig Exp $ */ /*- * Copyright (c) 2011 Abhinav Upadhyay * All rights reserved. @@ -31,7 +31,7 @@ */ #include -__RCSID("$NetBSD: apropos-utils.c,v 1.47 2019/08/18 09:14:30 abhinav Exp $"); +__RCSID("$NetBSD: apropos-utils.c,v 1.48 2021/11/27 22:30:25 rillig Exp $"); #include #include @@ -784,7 +784,7 @@ get_escaped_html_string(const char *src, do { \ memcpy(dst, (a), sizeof(a) - 1); \ dst += sizeof(a) - 1; \ -} while (/*CONSTCOND*/0) +} while (0) ddst = dst = emalloc(*slen + count * 5 + 1); Index: src/usr.sbin/ndp/ndp.c diff -u src/usr.sbin/ndp/ndp.c:1.58 src/usr.sbin/ndp/ndp.c:1.59 --- src/usr.sbin/ndp/ndp.c:1.58 Tue Sep 15 10:11:35 2020 +++ src/usr.sbin/ndp/ndp.c Sat Nov 27 22:30:25 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: ndp.c,v 1.58 2020/09/15 10:11:35 roy Exp $ */ +/* $NetBSD: ndp.c,v 1.59 2021/11/27 22:30:25 rillig Exp $ */ /* $KAME: ndp.c,v 1.121 2005/07/13 11:30:13 keiichi Exp $ */ /* @@ -812,7 +812,7 @@ ifinfo(char *ifname, int argc, char **ar newflags |= (f);\ flagset = true; \ }\ - } while (/*CONSTCOND*/0) + } while (0) /* * XXX: this macro is not 100% correct, in that it matches "nud" against * "nudbogus". But we just let it go since this is minor. @@ -833,7 +833,7 @@ ifinfo(char *ifname, int argc, char **ar v = newval; \ valset = true; \ } \ - } while (/*CONSTCOND*/0) + } while (0) #ifdef ND6_IFF_IFDISABLED SETFLAG("disabled", ND6_IFF_IFDISABLED); Index: src/usr.sbin/nfsd/nfsd.c diff -u src/usr.sbin/nfsd/nfsd.c:1.73 src/usr.sbin/nfsd/nfsd.c:1.74 --- src/usr.sbin/nfsd/nfsd.c:1.73 Thu Sep 17 12:48:12 2020 +++ src/usr.sbin/nfsd/nfsd.c Sat Nov 27 22:30:25 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: nfsd.c,v 1.73 2020/09/17 12:48:12 christos Exp $ */ +/* $NetBSD: nfsd.c,v 1.74 2021/11/27 22:30:25 rillig Exp $ */ /* * Copyright (c) 1989, 1993, 1994 @@ -42,7 +42,7 @@ __COPYRIGHT("@(#) Copyright (c) 1989, 19 #if 0 static char sccsid[] = "@(#)nfsd.c 8.9 (Berkeley) 3/29/95"; #else -__RCSID("$NetBSD: nfsd.c,v 1.73 2020/09/17 12:48:12 christos Exp $"
CVS commit: src/usr.bin
Module Name:src Committed By: rillig Date: Sat Nov 27 22:16:42 UTC 2021 Modified Files: src/usr.bin/cdplay: cdplay.c src/usr.bin/fdformat: fdformat.c src/usr.bin/mail: sig.c src/usr.bin/midiplay: midiplay.c src/usr.bin/su: su_pam.c src/usr.bin/vmstat: drvstats.c vmstat.c Log Message: usr.bin: remove unnecessary CONSTCOND, lint no longer needs it Since 2021-01-31, lint no longer requires a CONSTCOND comment in a do-while-0 statement since this is a common code pattern, especially in statement-like macros. To generate a diff of this commit: cvs rdiff -u -r1.50 -r1.51 src/usr.bin/cdplay/cdplay.c cvs rdiff -u -r1.17 -r1.18 src/usr.bin/fdformat/fdformat.c cvs rdiff -u -r1.3 -r1.4 src/usr.bin/mail/sig.c cvs rdiff -u -r1.33 -r1.34 src/usr.bin/midiplay/midiplay.c cvs rdiff -u -r1.22 -r1.23 src/usr.bin/su/su_pam.c cvs rdiff -u -r1.13 -r1.14 src/usr.bin/vmstat/drvstats.c cvs rdiff -u -r1.247 -r1.248 src/usr.bin/vmstat/vmstat.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/cdplay/cdplay.c diff -u src/usr.bin/cdplay/cdplay.c:1.50 src/usr.bin/cdplay/cdplay.c:1.51 --- src/usr.bin/cdplay/cdplay.c:1.50 Sun Oct 18 21:58:32 2020 +++ src/usr.bin/cdplay/cdplay.c Sat Nov 27 22:16:41 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: cdplay.c,v 1.50 2020/10/18 21:58:32 rillig Exp $ */ +/* $NetBSD: cdplay.c,v 1.51 2021/11/27 22:16:41 rillig Exp $ */ /* * Copyright (c) 1999, 2000, 2001 Andrew Doran. @@ -40,7 +40,7 @@ #include #ifndef lint -__RCSID("$NetBSD: cdplay.c,v 1.50 2020/10/18 21:58:32 rillig Exp $"); +__RCSID("$NetBSD: cdplay.c,v 1.51 2021/11/27 22:16:41 rillig Exp $"); #endif /* not lint */ #include @@ -130,7 +130,7 @@ static struct cmdtab { fd = -1; \ } else\ warn("ioctl(" #ctl ")");\ - } while (/* CONSTCOND */ 0) + } while (0) #define CDDA_SIZE 2352 Index: src/usr.bin/fdformat/fdformat.c diff -u src/usr.bin/fdformat/fdformat.c:1.17 src/usr.bin/fdformat/fdformat.c:1.18 --- src/usr.bin/fdformat/fdformat.c:1.17 Mon Sep 5 00:40:28 2016 +++ src/usr.bin/fdformat/fdformat.c Sat Nov 27 22:16:41 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: fdformat.c,v 1.17 2016/09/05 00:40:28 sevan Exp $ */ +/* $NetBSD: fdformat.c,v 1.18 2021/11/27 22:16:41 rillig Exp $ */ /*- * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc. @@ -36,7 +36,7 @@ #include #ifndef lint -__RCSID("$NetBSD: fdformat.c,v 1.17 2016/09/05 00:40:28 sevan Exp $"); +__RCSID("$NetBSD: fdformat.c,v 1.18 2021/11/27 22:16:41 rillig Exp $"); #endif #include @@ -135,7 +135,7 @@ usage(void) # which, optarg); \ parms.which = tmplong; \ parmmask |= MASK_##maskn; \ - } while (/* CONSTCOND */0) + } while (0) #define getparm(structname, maskname) \ do { \ @@ -144,7 +144,7 @@ usage(void) " missing for type `%s'", optarg); \ parms.structname = tmplong; \ parmmask |= MASK_ ## maskname; \ - } while (/* CONSTCOND */0) + } while (0) #define copyparm(which, mask) \ Index: src/usr.bin/mail/sig.c diff -u src/usr.bin/mail/sig.c:1.3 src/usr.bin/mail/sig.c:1.4 --- src/usr.bin/mail/sig.c:1.3 Tue Jun 12 19:03:26 2012 +++ src/usr.bin/mail/sig.c Sat Nov 27 22:16:41 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: sig.c,v 1.3 2012/06/12 19:03:26 christos Exp $ */ +/* $NetBSD: sig.c,v 1.4 2021/11/27 22:16:41 rillig Exp $ */ /* * Copyright (c) 1980, 1993 @@ -31,7 +31,7 @@ #include #ifndef lint -__RCSID("$NetBSD: sig.c,v 1.3 2012/06/12 19:03:26 christos Exp $"); +__RCSID("$NetBSD: sig.c,v 1.4 2021/11/27 22:16:41 rillig Exp $"); #endif /* not lint */ #include @@ -63,7 +63,7 @@ static struct { #define SIGQUEUE_INIT(p) do {\ (p)->qe_first = NULL;\ (p)->qe_last = &((p)->qe_first);\ - } while (/*CONSTCOND*/ 0) + } while (0) /* * The routines alloc_entry() and free_entry() manage the queue Index: src/usr.bin/midiplay/midiplay.c diff -u src/usr.bin/midiplay/midiplay.c:1.33 src/usr.bin/midiplay/midiplay.c:1.34 --- src/usr.bin/midiplay/midiplay.c:1.33 Fri Feb 1 08:37:21 2019 +++ src/usr.bin/midiplay/midiplay.c Sat Nov 27 22:16:41 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: midiplay.c,v 1.33 2019/02/01 08:37:21 mrg Exp $ */ +/* $NetBSD: midiplay.c,v 1.34 2021/11/27 22:16:41 rillig Exp $ */ /* * Copyright (c) 1998, 2002 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ #include #ifndef lint -__RCSID("$NetBSD: midiplay.c,v 1.33 2019/02/01 08:37:21 mrg Exp $"); +__RCSID("$NetBSD: midiplay.c,v 1.34 2021/11/27 22:16:41 rillig Exp $"); #endif @@ -842,7 +842,7 @@ main(int argc, char **argv) struct track *_t = t[i].indirect; \ t[i].indirect = t[j].indirect; \ t[j].indirect = _t; \ -} while (/*CONSTCOND*/ 0) +} while (0) static void Heapify(struct track *t, int ntrks, int node) Index: src/usr.bin/su/su_pam.c diff -u src/usr.bin/su/su_pam.c:1.22 src/usr.bin/su/su_pam.c:1.23 --- src/usr.bin/su/su_pam.c:1.22 Fri Sep 10 21:52:18
CVS commit: src/usr.bin
Module Name:src Committed By: rillig Date: Sat Nov 27 22:16:42 UTC 2021 Modified Files: src/usr.bin/cdplay: cdplay.c src/usr.bin/fdformat: fdformat.c src/usr.bin/mail: sig.c src/usr.bin/midiplay: midiplay.c src/usr.bin/su: su_pam.c src/usr.bin/vmstat: drvstats.c vmstat.c Log Message: usr.bin: remove unnecessary CONSTCOND, lint no longer needs it Since 2021-01-31, lint no longer requires a CONSTCOND comment in a do-while-0 statement since this is a common code pattern, especially in statement-like macros. To generate a diff of this commit: cvs rdiff -u -r1.50 -r1.51 src/usr.bin/cdplay/cdplay.c cvs rdiff -u -r1.17 -r1.18 src/usr.bin/fdformat/fdformat.c cvs rdiff -u -r1.3 -r1.4 src/usr.bin/mail/sig.c cvs rdiff -u -r1.33 -r1.34 src/usr.bin/midiplay/midiplay.c cvs rdiff -u -r1.22 -r1.23 src/usr.bin/su/su_pam.c cvs rdiff -u -r1.13 -r1.14 src/usr.bin/vmstat/drvstats.c cvs rdiff -u -r1.247 -r1.248 src/usr.bin/vmstat/vmstat.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/usr.bin/make
Module Name:src Committed By: rillig Date: Sat Nov 27 22:04:02 UTC 2021 Modified Files: src/usr.bin/make: make.h meta.c Log Message: make: remove CONSTCOND comments, lint no longer needs them To generate a diff of this commit: cvs rdiff -u -r1.265 -r1.266 src/usr.bin/make/make.h cvs rdiff -u -r1.184 -r1.185 src/usr.bin/make/meta.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/usr.bin/make
Module Name:src Committed By: rillig Date: Sat Nov 27 22:04:02 UTC 2021 Modified Files: src/usr.bin/make: make.h meta.c Log Message: make: remove CONSTCOND comments, lint no longer needs them To generate a diff of this commit: cvs rdiff -u -r1.265 -r1.266 src/usr.bin/make/make.h cvs rdiff -u -r1.184 -r1.185 src/usr.bin/make/meta.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/make/make.h diff -u src/usr.bin/make/make.h:1.265 src/usr.bin/make/make.h:1.266 --- src/usr.bin/make/make.h:1.265 Sun Sep 12 09:51:14 2021 +++ src/usr.bin/make/make.h Sat Nov 27 22:04:02 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: make.h,v 1.265 2021/09/12 09:51:14 rillig Exp $ */ +/* $NetBSD: make.h,v 1.266 2021/11/27 22:04:02 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -581,7 +581,7 @@ void debug_printf(const char *, ...) MAK do { \ if (DEBUG(module)) \ debug_printf args; \ - } while (/*CONSTCOND*/false) + } while (false) #define DEBUG0(module, text) \ DEBUG_IMPL(module, ("%s", text)) Index: src/usr.bin/make/meta.c diff -u src/usr.bin/make/meta.c:1.184 src/usr.bin/make/meta.c:1.185 --- src/usr.bin/make/meta.c:1.184 Sun Oct 24 18:45:46 2021 +++ src/usr.bin/make/meta.c Sat Nov 27 22:04:02 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: meta.c,v 1.184 2021/10/24 18:45:46 sjg Exp $ */ +/* $NetBSD: meta.c,v 1.185 2021/11/27 22:04:02 rillig Exp $ */ /* * Implement 'meta' mode. @@ -409,7 +409,7 @@ printCMDs(GNode *gn, FILE *fp) } \ return false; \ } \ -} while (/*CONSTCOND*/false) +} while (false) /* @@ -1711,7 +1711,7 @@ meta_compat_parent(pid_t child) fflush(stdout); buf[nread] = '\0'; meta_job_output(NULL, buf, ""); - } while (/*CONSTCOND*/false); + } while (false); if (metafd != -1 && FD_ISSET(metafd, &readfds) != 0) { if (meta_job_event(NULL) <= 0) metafd = -1;
CVS commit: src/usr.bin/indent
Module Name:src Committed By: rillig Date: Sat Nov 27 21:23:23 UTC 2021 Modified Files: src/usr.bin/indent: README.md Log Message: indent: reword README To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/usr.bin/indent/README.md 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/indent/README.md diff -u src/usr.bin/indent/README.md:1.1 src/usr.bin/indent/README.md:1.2 --- src/usr.bin/indent/README.md:1.1 Thu Nov 18 16:54:34 2021 +++ src/usr.bin/indent/README.md Sat Nov 27 21:23:23 2021 @@ -8,12 +8,12 @@ additions to provide "Kernel Normal Form Microsystems. Between 2000 and 2019, FreeBSD maintained the code, adding several features. -NetBSD imported these changes on 2019-04.04. +NetBSD imported these changes on 2019-04-04. -In 2021, indent was updated to handle C99 comments, cleaning up the code. It -got a proper test suite, uncovering many inconsistencies and bugs that either -had been there forever or had been introduced by importing the FreeBSD version -in 2019. +In 2021, indent was updated to handle C99 comments and the code got a major +overhaul. Indent got an extensive and systematic test suite, which uncovered +many inconsistencies and bugs. Several of these bugs had been introduced by +importing the FreeBSD version on 2019-04-04. # References
CVS commit: src/usr.bin/indent
Module Name:src Committed By: rillig Date: Sat Nov 27 21:23:23 UTC 2021 Modified Files: src/usr.bin/indent: README.md Log Message: indent: reword README To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/usr.bin/indent/README.md Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/usr.bin/indent
Module Name:src Committed By: rillig Date: Sat Nov 27 21:15:58 UTC 2021 Modified Files: src/usr.bin/indent: indent.c indent.h io.c Log Message: indent: accept a few formatting suggestions from indent The remaining issues are still that the conditions look ambiguous even with -eei, and that __attribute__ is broken into a separate line. No functional change. To generate a diff of this commit: cvs rdiff -u -r1.236 -r1.237 src/usr.bin/indent/indent.c cvs rdiff -u -r1.104 -r1.105 src/usr.bin/indent/indent.h cvs rdiff -u -r1.141 -r1.142 src/usr.bin/indent/io.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/indent/indent.c diff -u src/usr.bin/indent/indent.c:1.236 src/usr.bin/indent/indent.c:1.237 --- src/usr.bin/indent/indent.c:1.236 Sat Nov 27 18:37:17 2021 +++ src/usr.bin/indent/indent.c Sat Nov 27 21:15:58 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: indent.c,v 1.236 2021/11/27 18:37:17 rillig Exp $ */ +/* $NetBSD: indent.c,v 1.237 2021/11/27 21:15:58 rillig Exp $ */ /*- * SPDX-License-Identifier: BSD-4-Clause @@ -43,7 +43,7 @@ static char sccsid[] = "@(#)indent.c 5.1 #include #if defined(__NetBSD__) -__RCSID("$NetBSD: indent.c,v 1.236 2021/11/27 18:37:17 rillig Exp $"); +__RCSID("$NetBSD: indent.c,v 1.237 2021/11/27 21:15:58 rillig Exp $"); #elif defined(__FreeBSD__) __FBSDID("$FreeBSD: head/usr.bin/indent/indent.c 340138 2018-11-04 19:24:49Z oshogbo $"); #endif @@ -899,7 +899,7 @@ static void process_lbrace(bool *force_nl, bool *spaced_expr, stmt_head hd, int *di_stack, int di_stack_cap, int *decl_ind) { -ps.in_stmt_or_decl = false; /* don't indent the {} */ +ps.in_stmt_or_decl = false; /* don't indent the {} */ if (!ps.block_init) *force_nl = true; /* force other stuff on same line as '{' onto @@ -993,7 +993,7 @@ process_rbrace(bool *spaced_expr, int *d ps.in_stmt_or_decl = false; ps.in_stmt_cont = false; -if (ps.decl_level > 0) { /* we are in multi-level structure declaration */ +if (ps.decl_level > 0) { /* multi-level structure declaration */ *decl_ind = di_stack[--ps.decl_level]; if (ps.decl_level == 0 && !ps.in_func_def_params) { ps.just_saw_decl = 2; Index: src/usr.bin/indent/indent.h diff -u src/usr.bin/indent/indent.h:1.104 src/usr.bin/indent/indent.h:1.105 --- src/usr.bin/indent/indent.h:1.104 Sat Nov 27 18:37:17 2021 +++ src/usr.bin/indent/indent.h Sat Nov 27 21:15:58 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: indent.h,v 1.104 2021/11/27 18:37:17 rillig Exp $ */ +/* $NetBSD: indent.h,v 1.105 2021/11/27 21:15:58 rillig Exp $ */ /*- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD @@ -148,8 +148,8 @@ extern FILE *input; extern FILE *output; extern struct buffer token; /* the current token to be processed, is - * typically copied to the buffer 'code', - * or in some cases to 'lab'. */ + * typically copied to the buffer 'code', or + * in some cases to 'lab'. */ extern struct buffer lab; /* the label or preprocessor directive */ extern struct buffer code; /* the main part of the current line of code */ Index: src/usr.bin/indent/io.c diff -u src/usr.bin/indent/io.c:1.141 src/usr.bin/indent/io.c:1.142 --- src/usr.bin/indent/io.c:1.141 Sat Nov 27 18:37:17 2021 +++ src/usr.bin/indent/io.c Sat Nov 27 21:15:58 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: io.c,v 1.141 2021/11/27 18:37:17 rillig Exp $ */ +/* $NetBSD: io.c,v 1.142 2021/11/27 21:15:58 rillig Exp $ */ /*- * SPDX-License-Identifier: BSD-4-Clause @@ -43,7 +43,7 @@ static char sccsid[] = "@(#)io.c 8.1 (Be #include #if defined(__NetBSD__) -__RCSID("$NetBSD: io.c,v 1.141 2021/11/27 18:37:17 rillig Exp $"); +__RCSID("$NetBSD: io.c,v 1.142 2021/11/27 21:15:58 rillig Exp $"); #elif defined(__FreeBSD__) __FBSDID("$FreeBSD: head/usr.bin/indent/io.c 334927 2018-06-10 16:44:18Z pstef $"); #endif @@ -93,8 +93,8 @@ const char * inp_line_start(void) { /* - * The comment we're about to read usually comes from inp.buf, unless - * it has been copied into save_com. + * The comment we're about to read usually comes from inp.buf, unless it + * has been copied into save_com. */ return inbuf.saved_inp_s != NULL ? inbuf.save_com_buf : inbuf.inp.buf; } @@ -167,7 +167,7 @@ inp_comment_check_size(size_t n) return; diag(1, "Internal buffer overflow - " - "Move big comment from right after if, while, or whatever"); + "Move big comment from right after if, while, or whatever"); fflush(output); exit(1); } @@ -192,9 +192,8 @@ inp_comment_init_comment(void) return; /* - * Copy everything from the start of the line, because - * process_comment() will use that to calculate the original - * indentation of a boxed comment. + * Copy everything from the start of the line, because process_comment() + * will use that to calculate the original indentation of a boxed comment. */ /*
CVS commit: src/usr.bin/indent
Module Name:src Committed By: rillig Date: Sat Nov 27 21:15:58 UTC 2021 Modified Files: src/usr.bin/indent: indent.c indent.h io.c Log Message: indent: accept a few formatting suggestions from indent The remaining issues are still that the conditions look ambiguous even with -eei, and that __attribute__ is broken into a separate line. No functional change. To generate a diff of this commit: cvs rdiff -u -r1.236 -r1.237 src/usr.bin/indent/indent.c cvs rdiff -u -r1.104 -r1.105 src/usr.bin/indent/indent.h cvs rdiff -u -r1.141 -r1.142 src/usr.bin/indent/io.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/compat/linux32/arch
Module Name:src Committed By: ryo Date: Sat Nov 27 21:15:53 UTC 2021 Modified Files: src/sys/compat/linux32/arch/aarch64: linux32_syscall.h linux32_syscallargs.h linux32_syscalls.c linux32_sysent.c linux32_systrace_args.c src/sys/compat/linux32/arch/amd64: linux32_syscall.h linux32_syscallargs.h linux32_syscalls.c linux32_sysent.c linux32_systrace_args.c Log Message: regen To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 \ src/sys/compat/linux32/arch/aarch64/linux32_syscall.h \ src/sys/compat/linux32/arch/aarch64/linux32_syscallargs.h \ src/sys/compat/linux32/arch/aarch64/linux32_syscalls.c \ src/sys/compat/linux32/arch/aarch64/linux32_sysent.c \ src/sys/compat/linux32/arch/aarch64/linux32_systrace_args.c cvs rdiff -u -r1.85 -r1.86 \ src/sys/compat/linux32/arch/amd64/linux32_syscall.h \ src/sys/compat/linux32/arch/amd64/linux32_syscallargs.h \ src/sys/compat/linux32/arch/amd64/linux32_syscalls.c \ src/sys/compat/linux32/arch/amd64/linux32_sysent.c cvs rdiff -u -r1.12 -r1.13 \ src/sys/compat/linux32/arch/amd64/linux32_systrace_args.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/compat/linux32/arch/aarch64/linux32_syscall.h diff -u src/sys/compat/linux32/arch/aarch64/linux32_syscall.h:1.1 src/sys/compat/linux32/arch/aarch64/linux32_syscall.h:1.2 --- src/sys/compat/linux32/arch/aarch64/linux32_syscall.h:1.1 Thu Nov 25 03:08:04 2021 +++ src/sys/compat/linux32/arch/aarch64/linux32_syscall.h Sat Nov 27 21:15:53 2021 @@ -1,10 +1,10 @@ -/* $NetBSD: linux32_syscall.h,v 1.1 2021/11/25 03:08:04 ryo Exp $ */ +/* $NetBSD: linux32_syscall.h,v 1.2 2021/11/27 21:15:53 ryo Exp $ */ /* * System call numbers. * * DO NOT EDIT-- this file is automatically generated. - * created from NetBSD + * created from NetBSD: syscalls.master,v 1.2 2021/11/27 21:15:07 ryo Exp */ #ifndef _LINUX32_SYS_SYSCALL_H_ @@ -724,6 +724,9 @@ /* syscall: "faccessat" ret: "int" args: "int" "netbsd32_charp" "int" */ #define LINUX32_SYS_faccessat 334 +/* syscall: "pselect6" ret: "int" args: "int" "netbsd32_fd_setp_t" "netbsd32_fd_setp_t" "netbsd32_fd_setp_t" "linux32_timespecp_t" "linux32_sized_sigsetp_t" */ +#define LINUX32_SYS_pselect6 335 + /* syscall: "ppoll" ret: "int" args: "netbsd32_pollfdp_t" "u_int" "linux32_timespecp_t" "linux32_sigsetp_t" */ #define LINUX32_SYS_ppoll 336 Index: src/sys/compat/linux32/arch/aarch64/linux32_syscallargs.h diff -u src/sys/compat/linux32/arch/aarch64/linux32_syscallargs.h:1.1 src/sys/compat/linux32/arch/aarch64/linux32_syscallargs.h:1.2 --- src/sys/compat/linux32/arch/aarch64/linux32_syscallargs.h:1.1 Thu Nov 25 03:08:04 2021 +++ src/sys/compat/linux32/arch/aarch64/linux32_syscallargs.h Sat Nov 27 21:15:53 2021 @@ -1,10 +1,10 @@ -/* $NetBSD: linux32_syscallargs.h,v 1.1 2021/11/25 03:08:04 ryo Exp $ */ +/* $NetBSD: linux32_syscallargs.h,v 1.2 2021/11/27 21:15:53 ryo Exp $ */ /* * System call argument lists. * * DO NOT EDIT-- this file is automatically generated. - * created from NetBSD + * created from NetBSD: syscalls.master,v 1.2 2021/11/27 21:15:07 ryo Exp */ #ifndef _LINUX32_SYS_SYSCALLARGS_H_ @@ -1000,6 +1000,16 @@ struct linux32_sys_faccessat_args { }; check_syscall_args(linux32_sys_faccessat) +struct linux32_sys_pselect6_args { + syscallarg(int) nfds; + syscallarg(netbsd32_fd_setp_t) readfds; + syscallarg(netbsd32_fd_setp_t) writefds; + syscallarg(netbsd32_fd_setp_t) exceptfds; + syscallarg(linux32_timespecp_t) timeout; + syscallarg(linux32_sized_sigsetp_t) ss; +}; +check_syscall_args(linux32_sys_pselect6) + struct linux32_sys_ppoll_args { syscallarg(netbsd32_pollfdp_t) fds; syscallarg(u_int) nfds; @@ -1558,6 +1568,8 @@ int linux32_sys_fchmodat(struct lwp *, c int linux32_sys_faccessat(struct lwp *, const struct linux32_sys_faccessat_args *, register_t *); +int linux32_sys_pselect6(struct lwp *, const struct linux32_sys_pselect6_args *, register_t *); + int linux32_sys_ppoll(struct lwp *, const struct linux32_sys_ppoll_args *, register_t *); int netbsd32___futex_set_robust_list(struct lwp *, const struct netbsd32___futex_set_robust_list_args *, register_t *); Index: src/sys/compat/linux32/arch/aarch64/linux32_syscalls.c diff -u src/sys/compat/linux32/arch/aarch64/linux32_syscalls.c:1.1 src/sys/compat/linux32/arch/aarch64/linux32_syscalls.c:1.2 --- src/sys/compat/linux32/arch/aarch64/linux32_syscalls.c:1.1 Thu Nov 25 03:08:04 2021 +++ src/sys/compat/linux32/arch/aarch64/linux32_syscalls.c Sat Nov 27 21:15:53 2021 @@ -1,14 +1,14 @@ -/* $NetBSD: linux32_syscalls.c,v 1.1 2021/11/25 03:08:04 ryo Exp $ */ +/* $NetBSD: linux32_syscalls.c,v 1.2 2021/11/27 21:15:53 ryo Exp $ */ /* * System call names. * * DO NOT EDIT-- this file is automatically generated. - * created from NetBSD + * created from NetBSD: syscalls.master,v 1.2 2
CVS commit: src/sys/compat/linux32/arch
Module Name:src Committed By: ryo Date: Sat Nov 27 21:15:53 UTC 2021 Modified Files: src/sys/compat/linux32/arch/aarch64: linux32_syscall.h linux32_syscallargs.h linux32_syscalls.c linux32_sysent.c linux32_systrace_args.c src/sys/compat/linux32/arch/amd64: linux32_syscall.h linux32_syscallargs.h linux32_syscalls.c linux32_sysent.c linux32_systrace_args.c Log Message: regen To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 \ src/sys/compat/linux32/arch/aarch64/linux32_syscall.h \ src/sys/compat/linux32/arch/aarch64/linux32_syscallargs.h \ src/sys/compat/linux32/arch/aarch64/linux32_syscalls.c \ src/sys/compat/linux32/arch/aarch64/linux32_sysent.c \ src/sys/compat/linux32/arch/aarch64/linux32_systrace_args.c cvs rdiff -u -r1.85 -r1.86 \ src/sys/compat/linux32/arch/amd64/linux32_syscall.h \ src/sys/compat/linux32/arch/amd64/linux32_syscallargs.h \ src/sys/compat/linux32/arch/amd64/linux32_syscalls.c \ src/sys/compat/linux32/arch/amd64/linux32_sysent.c cvs rdiff -u -r1.12 -r1.13 \ src/sys/compat/linux32/arch/amd64/linux32_systrace_args.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/compat/linux32
Module Name:src Committed By: ryo Date: Sat Nov 27 21:15:07 UTC 2021 Modified Files: src/sys/compat/linux32/arch/aarch64: syscalls.master src/sys/compat/linux32/arch/amd64: syscalls.master src/sys/compat/linux32/common: linux32_signal.h linux32_types.h linux32_unistd.c Log Message: Add pselect6(2) system call to COMPAT_LINUX32 To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/compat/linux32/arch/aarch64/syscalls.master cvs rdiff -u -r1.75 -r1.76 src/sys/compat/linux32/arch/amd64/syscalls.master cvs rdiff -u -r1.5 -r1.6 src/sys/compat/linux32/common/linux32_signal.h cvs rdiff -u -r1.17 -r1.18 src/sys/compat/linux32/common/linux32_types.h cvs rdiff -u -r1.43 -r1.44 src/sys/compat/linux32/common/linux32_unistd.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/compat/linux32/arch/aarch64/syscalls.master diff -u src/sys/compat/linux32/arch/aarch64/syscalls.master:1.1 src/sys/compat/linux32/arch/aarch64/syscalls.master:1.2 --- src/sys/compat/linux32/arch/aarch64/syscalls.master:1.1 Thu Nov 25 03:08:04 2021 +++ src/sys/compat/linux32/arch/aarch64/syscalls.master Sat Nov 27 21:15:07 2021 @@ -1,4 +1,4 @@ - $NetBSD: syscalls.master,v 1.1 2021/11/25 03:08:04 ryo Exp $ + $NetBSD: syscalls.master,v 1.2 2021/11/27 21:15:07 ryo Exp $ ; NetBSD aarch64 COMPAT_LINUX32 system call name/number "master" file. ; @@ -584,7 +584,12 @@ linux_umode_t mode); } 334 STD { int|linux32_sys||faccessat(int fd, netbsd32_charp path, \ int amode); } -335 UNIMPL pselect6 +335 STD { int|linux32_sys||pselect6(int nfds, \ + netbsd32_fd_setp_t readfds, \ + netbsd32_fd_setp_t writefds, \ + netbsd32_fd_setp_t exceptfds, \ + linux32_timespecp_t timeout, \ + linux32_sized_sigsetp_t ss); } 336 STD { int|linux32_sys||ppoll(netbsd32_pollfdp_t fds, u_int nfds, \ linux32_timespecp_t timeout, linux32_sigsetp_t sigset); } 337 UNIMPL unshare Index: src/sys/compat/linux32/arch/amd64/syscalls.master diff -u src/sys/compat/linux32/arch/amd64/syscalls.master:1.75 src/sys/compat/linux32/arch/amd64/syscalls.master:1.76 --- src/sys/compat/linux32/arch/amd64/syscalls.master:1.75 Mon Sep 20 02:20:03 2021 +++ src/sys/compat/linux32/arch/amd64/syscalls.master Sat Nov 27 21:15:07 2021 @@ -1,4 +1,4 @@ - $NetBSD: syscalls.master,v 1.75 2021/09/20 02:20:03 thorpej Exp $ + $NetBSD: syscalls.master,v 1.76 2021/11/27 21:15:07 ryo Exp $ ; NetBSD i386 COMPAT_LINUX32 system call name/number "master" file. ; (See syscalls.conf to see what it is processed into.) @@ -527,7 +527,12 @@ linux_umode_t mode); } 307 STD { int|linux32_sys||faccessat(int fd, netbsd32_charp path, \ int amode); } -308 UNIMPL pselect6 +308 STD { int|linux32_sys||pselect6(int nfds, \ + netbsd32_fd_setp_t readfds, \ + netbsd32_fd_setp_t writefds, \ + netbsd32_fd_setp_t exceptfds, \ + linux32_timespecp_t timeout, \ + linux32_sized_sigsetp_t ss); } 309 STD { int|linux32_sys||ppoll(netbsd32_pollfdp_t fds, u_int nfds, \ linux32_timespecp_t timeout, linux32_sigsetp_t sigset); } 310 UNIMPL unshare Index: src/sys/compat/linux32/common/linux32_signal.h diff -u src/sys/compat/linux32/common/linux32_signal.h:1.5 src/sys/compat/linux32/common/linux32_signal.h:1.6 --- src/sys/compat/linux32/common/linux32_signal.h:1.5 Thu Nov 25 03:08:04 2021 +++ src/sys/compat/linux32/common/linux32_signal.h Sat Nov 27 21:15:07 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: linux32_signal.h,v 1.5 2021/11/25 03:08:04 ryo Exp $ */ +/* $NetBSD: linux32_signal.h,v 1.6 2021/11/27 21:15:07 ryo Exp $ */ /*- * Copyright (c) 2006 Emmanuel Dreyfus, all rights reserved. @@ -42,6 +42,11 @@ #error Undefined linux32_signal.h machine type. #endif +typedef struct { + linux32_sigsetp_t ss; + netbsd32_size_t ss_len; +} linux32_sized_sigset_t; + void linux32_to_native_sigset(sigset_t *, const linux32_sigset_t *); void native_to_linux32_sigset(linux32_sigset_t *, const sigset_t *); int linux32_to_native_sigflags(const unsigned long); Index: src/sys/compat/linux32/common/linux32_types.h diff -u src/sys/compat/linux32/common/linux32_types.h:1.17 src/sys/compat/linux32/common/linux32_types.h:1.18 --- src/sys/compat/linux32/common/linux32_types.h:1.17 Thu Nov 25 03:08:04 2021 +++ src/sys/compat/linux32/common/linux32_types.h Sat Nov 27 21:15:07 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: linux32_types.h,v 1.17 2021/11/25 03:08:04 ryo Exp $ */ +/* $NetBSD: linux32_types.h,v 1.18 2021/11/27 21:15:07 ryo Exp $ */ /*- * Copyright (c) 2006 Emmanuel Dreyfus, all rights reserved. @@ -54,6 +54,7 @@ typedef netbsd32_pointer_t linux32_statf typedef netbsd32_pointer_t linux32_statxp; typedef netbsd32_pointer_t linux32_sigactionp_t; typedef netbsd32_pointer_t linux32_sigsetp_t; +typedef netbsd32_pointer_t linux32_sized_sigsetp_t; typedef netbsd32_pointer_t linux32___sysctlp_t; typedef netbsd32_pointer_t linux3
CVS commit: src/sys/compat/linux32
Module Name:src Committed By: ryo Date: Sat Nov 27 21:15:07 UTC 2021 Modified Files: src/sys/compat/linux32/arch/aarch64: syscalls.master src/sys/compat/linux32/arch/amd64: syscalls.master src/sys/compat/linux32/common: linux32_signal.h linux32_types.h linux32_unistd.c Log Message: Add pselect6(2) system call to COMPAT_LINUX32 To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/compat/linux32/arch/aarch64/syscalls.master cvs rdiff -u -r1.75 -r1.76 src/sys/compat/linux32/arch/amd64/syscalls.master cvs rdiff -u -r1.5 -r1.6 src/sys/compat/linux32/common/linux32_signal.h cvs rdiff -u -r1.17 -r1.18 src/sys/compat/linux32/common/linux32_types.h cvs rdiff -u -r1.43 -r1.44 src/sys/compat/linux32/common/linux32_unistd.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/usr.bin/indent
Module Name:src Committed By: rillig Date: Sat Nov 27 20:58:16 UTC 2021 Modified Files: src/usr.bin/indent: lexi.c Log Message: indent: illustrate probably_looking_at_definition with examples No functional change. To generate a diff of this commit: cvs rdiff -u -r1.165 -r1.166 src/usr.bin/indent/lexi.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/indent/lexi.c diff -u src/usr.bin/indent/lexi.c:1.165 src/usr.bin/indent/lexi.c:1.166 --- src/usr.bin/indent/lexi.c:1.165 Sat Nov 27 20:33:39 2021 +++ src/usr.bin/indent/lexi.c Sat Nov 27 20:58:16 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: lexi.c,v 1.165 2021/11/27 20:33:39 rillig Exp $ */ +/* $NetBSD: lexi.c,v 1.166 2021/11/27 20:58:16 rillig Exp $ */ /*- * SPDX-License-Identifier: BSD-4-Clause @@ -43,7 +43,7 @@ static char sccsid[] = "@(#)lexi.c 8.1 ( #include #if defined(__NetBSD__) -__RCSID("$NetBSD: lexi.c,v 1.165 2021/11/27 20:33:39 rillig Exp $"); +__RCSID("$NetBSD: lexi.c,v 1.166 2021/11/27 20:58:16 rillig Exp $"); #elif defined(__FreeBSD__) __FBSDID("$FreeBSD: head/usr.bin/indent/lexi.c 337862 2018-08-15 18:19:45Z pstef $"); #endif @@ -451,7 +451,7 @@ cmp_keyword_by_name(const void *key, con } /* - * Looking at a line starting with 'function_name(something)', guess whether + * Looking at something like 'function_name(...)' in a line, guess whether * this starts a function definition or a declaration. */ static bool @@ -463,14 +463,20 @@ probably_looking_at_definition(void) paren_level++; if (*p == ')' && --paren_level == 0) { p++; + while (p < e && (ch_isspace(*p) || is_identifier_part(*p))) - p++; - if (p < e && (*p == ';' || *p == ',')) + p++; /* '__dead' or '__unused' */ + + if (p == e) /* func(...) */ + break; + if (*p == ';') /* func(...); */ return false; - if (p < e && *p == '(') - paren_level++; + if (*p == ',') /* double abs(), pi; */ + return false; + if (*p == '(') /* func(...) __attribute__((...)) */ + paren_level++; /* func(...) __printflike(...) */ else - break; + break; /* func(...) { ... */ } }
CVS commit: src/usr.bin/indent
Module Name:src Committed By: rillig Date: Sat Nov 27 20:58:16 UTC 2021 Modified Files: src/usr.bin/indent: lexi.c Log Message: indent: illustrate probably_looking_at_definition with examples No functional change. To generate a diff of this commit: cvs rdiff -u -r1.165 -r1.166 src/usr.bin/indent/lexi.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src
Module Name:src Committed By: rillig Date: Sat Nov 27 20:33:39 UTC 2021 Modified Files: src/tests/usr.bin/indent: fmt_decl.c src/usr.bin/indent: lexi.c Log Message: indent: fix out of bounds memory access (since 2021-11-25) To generate a diff of this commit: cvs rdiff -u -r1.31 -r1.32 src/tests/usr.bin/indent/fmt_decl.c cvs rdiff -u -r1.164 -r1.165 src/usr.bin/indent/lexi.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tests/usr.bin/indent/fmt_decl.c diff -u src/tests/usr.bin/indent/fmt_decl.c:1.31 src/tests/usr.bin/indent/fmt_decl.c:1.32 --- src/tests/usr.bin/indent/fmt_decl.c:1.31 Sat Nov 27 19:21:42 2021 +++ src/tests/usr.bin/indent/fmt_decl.c Sat Nov 27 20:33:39 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: fmt_decl.c,v 1.31 2021/11/27 19:21:42 rillig Exp $ */ +/* $NetBSD: fmt_decl.c,v 1.32 2021/11/27 20:33:39 rillig Exp $ */ /* $FreeBSD: head/usr.bin/indent/tests/declarations.0 334478 2018-06-01 09:41:15Z pstef $ */ /* @@ -831,13 +831,13 @@ char str[sizeof(**ptr)]; /* - * FIXME: Whether or not the function 'a' is a declaration or a definition - * depends on the preceding struct, in particular the length of the 'pn' - * line. This doesn't make sense at all and looks like an out-of-bounds memory - * access. + * Since lexi.c 1.158 from 2021-11-25, whether the function 'a' was considered + * a declaration or a definition depended on the preceding struct, in + * particular the length of the 'pn' line. This didn't make sense at all and + * was due to an out-of-bounds memory access. * - * Since lexi.c 1.158 from 2021-11-25. * Seen amongst others in args.c 1.72, function add_typedefs_from_file. + * Fixed in lexi.c 1.165 from 2021-11-27. */ #indent input struct { @@ -868,7 +868,8 @@ struct { }; static void - a(char *fe){ +a(char *fe) +{ } struct { Index: src/usr.bin/indent/lexi.c diff -u src/usr.bin/indent/lexi.c:1.164 src/usr.bin/indent/lexi.c:1.165 --- src/usr.bin/indent/lexi.c:1.164 Thu Nov 25 18:48:37 2021 +++ src/usr.bin/indent/lexi.c Sat Nov 27 20:33:39 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: lexi.c,v 1.164 2021/11/25 18:48:37 rillig Exp $ */ +/* $NetBSD: lexi.c,v 1.165 2021/11/27 20:33:39 rillig Exp $ */ /*- * SPDX-License-Identifier: BSD-4-Clause @@ -43,7 +43,7 @@ static char sccsid[] = "@(#)lexi.c 8.1 ( #include #if defined(__NetBSD__) -__RCSID("$NetBSD: lexi.c,v 1.164 2021/11/25 18:48:37 rillig Exp $"); +__RCSID("$NetBSD: lexi.c,v 1.165 2021/11/27 20:33:39 rillig Exp $"); #elif defined(__FreeBSD__) __FBSDID("$FreeBSD: head/usr.bin/indent/lexi.c 337862 2018-08-15 18:19:45Z pstef $"); #endif @@ -450,21 +450,27 @@ cmp_keyword_by_name(const void *key, con return strcmp(key, ((const struct keyword *)elem)->name); } +/* + * Looking at a line starting with 'function_name(something)', guess whether + * this starts a function definition or a declaration. + */ static bool probably_looking_at_definition(void) { int paren_level = 0; for (const char *p = inp_p(), *e = inp_line_end(); p < e; p++) { -proceed: if (*p == '(') paren_level++; if (*p == ')' && --paren_level == 0) { p++; while (p < e && (ch_isspace(*p) || is_identifier_part(*p))) p++; - if (*p == '(') - goto proceed; - return !(*p == ';' || *p == ','); + if (p < e && (*p == ';' || *p == ',')) + return false; + if (p < e && *p == '(') + paren_level++; + else + break; } }
CVS commit: src
Module Name:src Committed By: rillig Date: Sat Nov 27 20:33:39 UTC 2021 Modified Files: src/tests/usr.bin/indent: fmt_decl.c src/usr.bin/indent: lexi.c Log Message: indent: fix out of bounds memory access (since 2021-11-25) To generate a diff of this commit: cvs rdiff -u -r1.31 -r1.32 src/tests/usr.bin/indent/fmt_decl.c cvs rdiff -u -r1.164 -r1.165 src/usr.bin/indent/lexi.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/usr.bin/xlint/lint1
Module Name:src Committed By: christos Date: Sat Nov 27 20:13:48 UTC 2021 Modified Files: src/usr.bin/xlint/lint1: cgram.y lex.c Log Message: Add target attribute To generate a diff of this commit: cvs rdiff -u -r1.370 -r1.371 src/usr.bin/xlint/lint1/cgram.y cvs rdiff -u -r1.87 -r1.88 src/usr.bin/xlint/lint1/lex.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/cgram.y diff -u src/usr.bin/xlint/lint1/cgram.y:1.370 src/usr.bin/xlint/lint1/cgram.y:1.371 --- src/usr.bin/xlint/lint1/cgram.y:1.370 Tue Nov 16 16:01:05 2021 +++ src/usr.bin/xlint/lint1/cgram.y Sat Nov 27 15:13:48 2021 @@ -1,5 +1,5 @@ %{ -/* $NetBSD: cgram.y,v 1.370 2021/11/16 21:01:05 rillig Exp $ */ +/* $NetBSD: cgram.y,v 1.371 2021/11/27 20:13:48 christos Exp $ */ /* * Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved. @@ -35,7 +35,7 @@ #include #if defined(__RCSID) && !defined(lint) -__RCSID("$NetBSD: cgram.y,v 1.370 2021/11/16 21:01:05 rillig Exp $"); +__RCSID("$NetBSD: cgram.y,v 1.371 2021/11/27 20:13:48 christos Exp $"); #endif #include @@ -257,6 +257,7 @@ anonymize(sym_t *s) %token T_AT_SECTION %token T_AT_SENTINEL %token T_AT_STRING +%token T_AT_TARGET %token T_AT_TLS_MODEL %token T_AT_TUNION %token T_AT_UNUSED @@ -2098,6 +2099,7 @@ gcc_attribute_spec: | T_AT_SECTION T_LPAREN string T_RPAREN | T_AT_SENTINEL T_LPAREN constant_expr T_RPAREN | T_AT_SENTINEL + | T_AT_TARGET T_LPAREN string T_RPAREN | T_AT_TLS_MODEL T_LPAREN string T_RPAREN | T_AT_TUNION | T_AT_UNUSED { Index: src/usr.bin/xlint/lint1/lex.c diff -u src/usr.bin/xlint/lint1/lex.c:1.87 src/usr.bin/xlint/lint1/lex.c:1.88 --- src/usr.bin/xlint/lint1/lex.c:1.87 Tue Nov 16 13:33:14 2021 +++ src/usr.bin/xlint/lint1/lex.c Sat Nov 27 15:13:48 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: lex.c,v 1.87 2021/11/16 18:33:14 rillig Exp $ */ +/* $NetBSD: lex.c,v 1.88 2021/11/27 20:13:48 christos Exp $ */ /* * Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved. @@ -38,7 +38,7 @@ #include #if defined(__RCSID) && !defined(lint) -__RCSID("$NetBSD: lex.c,v 1.87 2021/11/16 18:33:14 rillig Exp $"); +__RCSID("$NetBSD: lex.c,v 1.88 2021/11/27 20:13:48 christos Exp $"); #endif #include @@ -224,6 +224,7 @@ static struct kwtab { kwdef_keyword( "switch", T_SWITCH), kwdef_token( "__symbolrename", T_SYMBOLRENAME, 0,0,0,0,1), kwdef_gcc_attr( "syslog", T_AT_FORMAT_SYSLOG), + kwdef_gcc_attr( "target", T_AT_TARGET), kwdef_tqual( "__thread", THREAD, 0,0,1,0,1), kwdef_tqual( "_Thread_local", THREAD, 0,1,0,0,1), kwdef_gcc_attr( "tls_model", T_AT_TLS_MODEL),
CVS commit: src/usr.bin/xlint/lint1
Module Name:src Committed By: christos Date: Sat Nov 27 20:13:48 UTC 2021 Modified Files: src/usr.bin/xlint/lint1: cgram.y lex.c Log Message: Add target attribute To generate a diff of this commit: cvs rdiff -u -r1.370 -r1.371 src/usr.bin/xlint/lint1/cgram.y cvs rdiff -u -r1.87 -r1.88 src/usr.bin/xlint/lint1/lex.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch/evbarm/conf
Module Name:src Committed By: ryo Date: Sat Nov 27 19:55:21 UTC 2021 Modified Files: src/sys/arch/evbarm/conf: GENERIC64 Log Message: add options COMPAT_LINUX32 (commented out) To generate a diff of this commit: cvs rdiff -u -r1.187 -r1.188 src/sys/arch/evbarm/conf/GENERIC64 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/evbarm/conf/GENERIC64 diff -u src/sys/arch/evbarm/conf/GENERIC64:1.187 src/sys/arch/evbarm/conf/GENERIC64:1.188 --- src/sys/arch/evbarm/conf/GENERIC64:1.187 Sun Oct 10 13:03:09 2021 +++ src/sys/arch/evbarm/conf/GENERIC64 Sat Nov 27 19:55:20 2021 @@ -1,5 +1,5 @@ # -# $NetBSD: GENERIC64,v 1.187 2021/10/10 13:03:09 jmcneill Exp $ +# $NetBSD: GENERIC64,v 1.188 2021/11/27 19:55:20 ryo Exp $ # # GENERIC ARM (aarch64) kernel # @@ -90,6 +90,7 @@ options COMPAT_NETBSD32 options EXEC_ELF32 #options COMPAT_LINUX # binary compatibility with Linux +#options COMPAT_LINUX32 # binary compatibility with Linux 32-bit #options COMPAT_50 # COMPAT_LINUX depends on #options COMPAT_OSSAUDIO # binary compatibility with Linux
CVS commit: src/sys/arch/evbarm/conf
Module Name:src Committed By: ryo Date: Sat Nov 27 19:55:21 UTC 2021 Modified Files: src/sys/arch/evbarm/conf: GENERIC64 Log Message: add options COMPAT_LINUX32 (commented out) To generate a diff of this commit: cvs rdiff -u -r1.187 -r1.188 src/sys/arch/evbarm/conf/GENERIC64 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/tests/usr.bin/indent
Module Name:src Committed By: rillig Date: Sat Nov 27 19:21:42 UTC 2021 Modified Files: src/tests/usr.bin/indent: fmt_decl.c Log Message: tests/indent: demonstrate strange formatting (since 2021-11-25) To generate a diff of this commit: cvs rdiff -u -r1.30 -r1.31 src/tests/usr.bin/indent/fmt_decl.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/tests/usr.bin/indent
Module Name:src Committed By: rillig Date: Sat Nov 27 19:21:42 UTC 2021 Modified Files: src/tests/usr.bin/indent: fmt_decl.c Log Message: tests/indent: demonstrate strange formatting (since 2021-11-25) To generate a diff of this commit: cvs rdiff -u -r1.30 -r1.31 src/tests/usr.bin/indent/fmt_decl.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tests/usr.bin/indent/fmt_decl.c diff -u src/tests/usr.bin/indent/fmt_decl.c:1.30 src/tests/usr.bin/indent/fmt_decl.c:1.31 --- src/tests/usr.bin/indent/fmt_decl.c:1.30 Thu Nov 25 20:02:06 2021 +++ src/tests/usr.bin/indent/fmt_decl.c Sat Nov 27 19:21:42 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: fmt_decl.c,v 1.30 2021/11/25 20:02:06 rillig Exp $ */ +/* $NetBSD: fmt_decl.c,v 1.31 2021/11/27 19:21:42 rillig Exp $ */ /* $FreeBSD: head/usr.bin/indent/tests/declarations.0 334478 2018-06-01 09:41:15Z pstef $ */ /* @@ -828,3 +828,56 @@ char str[sizeof(*ptr)]; char str[sizeof(type * *)]; char str[sizeof(**ptr)]; #indent end + + +/* + * FIXME: Whether or not the function 'a' is a declaration or a definition + * depends on the preceding struct, in particular the length of the 'pn' + * line. This doesn't make sense at all and looks like an out-of-bounds memory + * access. + * + * Since lexi.c 1.158 from 2021-11-25. + * Seen amongst others in args.c 1.72, function add_typedefs_from_file. + */ +#indent input +struct { +} v = { +pn("ta"), +}; + +static void +a(char *fe) +{ +} + +struct { +} v = { +pn("t"), +}; + +static void +a(char *fe) +{ +} +#indent end + +#indent run -di0 +struct { +} v = { + pn("ta"), +}; + +static void + a(char *fe){ +} + +struct { +} v = { + pn("t"), +}; + +static void +a(char *fe) +{ +} +#indent end
CVS commit: src/etc
Module Name:src Committed By: uwe Date: Sat Nov 27 18:39:15 UTC 2021 Modified Files: src/etc: shells Log Message: /etc/shells - Add tmux. We ship tmux in base and tmux can be used as user's default shell. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/etc/shells Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/etc/shells diff -u src/etc/shells:1.4 src/etc/shells:1.5 --- src/etc/shells:1.4 Fri Oct 8 18:02:57 2021 +++ src/etc/shells Sat Nov 27 18:39:15 2021 @@ -1,4 +1,4 @@ -# $NetBSD: shells,v 1.4 2021/10/08 18:02:57 nia Exp $ +# $NetBSD: shells,v 1.5 2021/11/27 18:39:15 uwe Exp $ # # List of acceptable shells for chpass(1). # Ftpd will not allow users to connect who are not using @@ -8,3 +8,4 @@ /bin/csh /bin/ksh /rescue/sh +/usr/bin/tmux
CVS commit: src/etc
Module Name:src Committed By: uwe Date: Sat Nov 27 18:39:15 UTC 2021 Modified Files: src/etc: shells Log Message: /etc/shells - Add tmux. We ship tmux in base and tmux can be used as user's default shell. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/etc/shells Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src
Module Name:src Committed By: rillig Date: Sat Nov 27 18:37:17 UTC 2021 Modified Files: src/tests/usr.bin/indent: token_comment.c src/usr.bin/indent: indent.c indent.h io.c pr_comment.c Log Message: indent: rename dump functions to output No functional change. To generate a diff of this commit: cvs rdiff -u -r1.26 -r1.27 src/tests/usr.bin/indent/token_comment.c cvs rdiff -u -r1.235 -r1.236 src/usr.bin/indent/indent.c cvs rdiff -u -r1.103 -r1.104 src/usr.bin/indent/indent.h cvs rdiff -u -r1.140 -r1.141 src/usr.bin/indent/io.c cvs rdiff -u -r1.125 -r1.126 src/usr.bin/indent/pr_comment.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tests/usr.bin/indent/token_comment.c diff -u src/tests/usr.bin/indent/token_comment.c:1.26 src/tests/usr.bin/indent/token_comment.c:1.27 --- src/tests/usr.bin/indent/token_comment.c:1.26 Thu Nov 25 20:44:10 2021 +++ src/tests/usr.bin/indent/token_comment.c Sat Nov 27 18:37:17 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: token_comment.c,v 1.26 2021/11/25 20:44:10 rillig Exp $ */ +/* $NetBSD: token_comment.c,v 1.27 2021/11/27 18:37:17 rillig Exp $ */ /* $FreeBSD$ */ /* @@ -895,7 +895,7 @@ int decl; /* * A completely empty line in a box comment must be copied unmodified to the * output. This is done in process_comment by adding a space to the end of an - * otherwise empty comment. This space forces dump_line to add some output, + * otherwise empty comment. This space forces output_complete_line to add some output, * but the trailing space is discarded, resulting in an empty line. */ #indent input Index: src/usr.bin/indent/indent.c diff -u src/usr.bin/indent/indent.c:1.235 src/usr.bin/indent/indent.c:1.236 --- src/usr.bin/indent/indent.c:1.235 Sat Nov 27 18:29:29 2021 +++ src/usr.bin/indent/indent.c Sat Nov 27 18:37:17 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: indent.c,v 1.235 2021/11/27 18:29:29 rillig Exp $ */ +/* $NetBSD: indent.c,v 1.236 2021/11/27 18:37:17 rillig Exp $ */ /*- * SPDX-License-Identifier: BSD-4-Clause @@ -43,7 +43,7 @@ static char sccsid[] = "@(#)indent.c 5.1 #include #if defined(__NetBSD__) -__RCSID("$NetBSD: indent.c,v 1.235 2021/11/27 18:29:29 rillig Exp $"); +__RCSID("$NetBSD: indent.c,v 1.236 2021/11/27 18:37:17 rillig Exp $"); #elif defined(__FreeBSD__) __FBSDID("$FreeBSD: head/usr.bin/indent/indent.c 340138 2018-11-04 19:24:49Z oshogbo $"); #endif @@ -596,7 +596,7 @@ static void __attribute__((__noreturn__) process_eof(void) { if (lab.s != lab.e || code.s != code.e || com.s != com.e) - dump_line(); + output_line(); if (ps.tos > 1) /* check for balanced braces */ diag(1, "Stuff missing from end of file"); @@ -624,7 +624,7 @@ maybe_break_line(lexer_symbol lsym, bool if (opt.verbose) diag(0, "Line broken"); -dump_line(); +output_line(); ps.want_blank = false; *force_nl = false; } @@ -643,7 +643,7 @@ move_com_to_code(void) static void process_form_feed(void) { -dump_line_ff(); +output_line_ff(); ps.want_blank = false; } @@ -655,7 +655,7 @@ process_newline(void) com.s == com.e) goto stay_in_line; -dump_line(); +output_line(); ps.want_blank = false; stay_in_line: @@ -911,13 +911,13 @@ process_lbrace(bool *force_nl, bool *spa if (code.s != code.e && !ps.block_init) { if (!opt.brace_same_line) { - dump_line(); + output_line(); ps.want_blank = false; } else if (ps.in_func_def_params && !ps.init_or_struct) { ps.ind_level_follow = 0; if (opt.function_brace_split) { /* dump the line prior to the * brace ... */ - dump_line(); + output_line(); ps.want_blank = false; } else /* add a space between the decl and brace */ ps.want_blank = true; @@ -985,7 +985,7 @@ process_rbrace(bool *spaced_expr, int *d if (code.s != code.e && !ps.block_init) { /* '}' must be first on line */ if (opt.verbose) diag(0, "Line broken"); - dump_line(); + output_line(); } *code.e++ = '}'; @@ -1021,7 +1021,7 @@ process_do(bool *force_nl, bool *last_el if (code.e != code.s) { /* make sure this starts a line */ if (opt.verbose) diag(0, "Line broken"); - dump_line(); + output_line(); ps.want_blank = false; } @@ -1038,7 +1038,7 @@ process_else(bool *force_nl, bool *last_ if (code.e > code.s && !(opt.cuddle_else && code.e[-1] == '}')) { if (opt.verbose) diag(0, "Line broken"); - dump_line(); /* make sure this starts a line */ + output_line(); /* make sure this starts a line */ ps.want_blank = false; } @@ -1054,7 +1054,7 @@ process_type(int *decl_ind, bool *tabs_t if (ps.prev_token == lsym_rparen_or_rbracket && ps.tos <= 1) { if (code.s != code.e) { - dump_line(); + output_line(); ps.want_blank = false; } } @@ -1089,7 +1089,7 @@ process_ident(lexer_symbol lsym, int dec ps.in_decl = false; if (opt.procnames_start_l
CVS commit: src
Module Name:src Committed By: rillig Date: Sat Nov 27 18:37:17 UTC 2021 Modified Files: src/tests/usr.bin/indent: token_comment.c src/usr.bin/indent: indent.c indent.h io.c pr_comment.c Log Message: indent: rename dump functions to output No functional change. To generate a diff of this commit: cvs rdiff -u -r1.26 -r1.27 src/tests/usr.bin/indent/token_comment.c cvs rdiff -u -r1.235 -r1.236 src/usr.bin/indent/indent.c cvs rdiff -u -r1.103 -r1.104 src/usr.bin/indent/indent.h cvs rdiff -u -r1.140 -r1.141 src/usr.bin/indent/io.c cvs rdiff -u -r1.125 -r1.126 src/usr.bin/indent/pr_comment.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/usr.bin/indent
Module Name:src Committed By: rillig Date: Sat Nov 27 18:29:29 UTC 2021 Modified Files: src/usr.bin/indent: indent.c Log Message: indent: inline switch_buffer The function name was not accurate all the time. Now that inp_from_comment is a separate function, it doesn't make sense anymore to offload the 3 simple statements to a separate function. No functional change. To generate a diff of this commit: cvs rdiff -u -r1.234 -r1.235 src/usr.bin/indent/indent.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/indent/indent.c diff -u src/usr.bin/indent/indent.c:1.234 src/usr.bin/indent/indent.c:1.235 --- src/usr.bin/indent/indent.c:1.234 Fri Nov 26 15:18:18 2021 +++ src/usr.bin/indent/indent.c Sat Nov 27 18:29:29 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: indent.c,v 1.234 2021/11/26 15:18:18 rillig Exp $ */ +/* $NetBSD: indent.c,v 1.235 2021/11/27 18:29:29 rillig Exp $ */ /*- * SPDX-License-Identifier: BSD-4-Clause @@ -43,7 +43,7 @@ static char sccsid[] = "@(#)indent.c 5.1 #include #if defined(__NetBSD__) -__RCSID("$NetBSD: indent.c,v 1.234 2021/11/26 15:18:18 rillig Exp $"); +__RCSID("$NetBSD: indent.c,v 1.235 2021/11/27 18:29:29 rillig Exp $"); #elif defined(__FreeBSD__) __FBSDID("$FreeBSD: head/usr.bin/indent/indent.c 340138 2018-11-04 19:24:49Z oshogbo $"); #endif @@ -269,11 +269,11 @@ search_stmt_comment(void) if (token.e[-1] == '/') { while (inp_peek() != '\n') inp_comment_add_char(inp_next()); - debug_inp("search_stmt_comment end C99"); + debug_inp("search_stmt_comment: end of C99 comment"); } else { while (!inp_comment_complete_block()) inp_comment_add_char(inp_next()); - debug_inp("search_stmt_comment end block"); + debug_inp("search_stmt_comment: end of block comment"); } } @@ -330,8 +330,8 @@ search_stmt_other(lexer_symbol lsym, boo inp_comment_rtrim_newline(); } -if (*force_nl) { /* if we should insert a nl here, put it into - * the buffer */ +if (*force_nl) { /* if we should insert a newline here, put it + * into the buffer */ *force_nl = false; --line_no; /* this will be re-increased when the newline * is read from the buffer */ @@ -348,14 +348,6 @@ search_stmt_other(lexer_symbol lsym, boo } static void -switch_buffer(void) -{ -ps.search_stmt = false; -inp_comment_add_char(' '); /* add trailing blank, just in case */ -inp_from_comment(); -} - -static void search_stmt_lookahead(lexer_symbol *lsym) { if (*lsym == lsym_eof) @@ -426,7 +418,9 @@ search_stmt(lexer_symbol *lsym, bool *fo *last_else)) return; switch_buffer: - switch_buffer(); + ps.search_stmt = false; + inp_comment_add_char(' '); /* add trailing blank, just in case */ + inp_from_comment(); } search_stmt_lookahead(lsym); }
CVS commit: src/usr.bin/indent
Module Name:src Committed By: rillig Date: Sat Nov 27 18:29:29 UTC 2021 Modified Files: src/usr.bin/indent: indent.c Log Message: indent: inline switch_buffer The function name was not accurate all the time. Now that inp_from_comment is a separate function, it doesn't make sense anymore to offload the 3 simple statements to a separate function. No functional change. To generate a diff of this commit: cvs rdiff -u -r1.234 -r1.235 src/usr.bin/indent/indent.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/usr.bin/indent
Module Name:src Committed By: rillig Date: Sat Nov 27 18:26:48 UTC 2021 Modified Files: src/usr.bin/indent: io.c Log Message: indent: add assertions for input handling Just to document the invariants; the code is already OK. To generate a diff of this commit: cvs rdiff -u -r1.139 -r1.140 src/usr.bin/indent/io.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/indent/io.c diff -u src/usr.bin/indent/io.c:1.139 src/usr.bin/indent/io.c:1.140 --- src/usr.bin/indent/io.c:1.139 Fri Nov 26 15:21:38 2021 +++ src/usr.bin/indent/io.c Sat Nov 27 18:26:48 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: io.c,v 1.139 2021/11/26 15:21:38 rillig Exp $ */ +/* $NetBSD: io.c,v 1.140 2021/11/27 18:26:48 rillig Exp $ */ /*- * SPDX-License-Identifier: BSD-4-Clause @@ -43,7 +43,7 @@ static char sccsid[] = "@(#)io.c 8.1 (Be #include #if defined(__NetBSD__) -__RCSID("$NetBSD: io.c,v 1.139 2021/11/26 15:21:38 rillig Exp $"); +__RCSID("$NetBSD: io.c,v 1.140 2021/11/27 18:26:48 rillig Exp $"); #elif defined(__FreeBSD__) __FBSDID("$FreeBSD: head/usr.bin/indent/io.c 334927 2018-06-10 16:44:18Z pstef $"); #endif @@ -85,6 +85,7 @@ inp_init(void) const char * inp_p(void) { +assert(inbuf.inp.s < inbuf.inp.e); return inbuf.inp.s; } @@ -107,18 +108,21 @@ inp_line_end(void) char inp_peek(void) { +assert(inbuf.inp.s < inbuf.inp.e); return *inbuf.inp.s; } char inp_lookahead(size_t i) { +assert(i < (size_t)(inbuf.inp.e - inbuf.inp.s)); return inbuf.inp.s[i]; } void inp_skip(void) { +assert(inbuf.inp.s < inbuf.inp.e); inbuf.inp.s++; if (inbuf.inp.s >= inbuf.inp.e) inp_read_line();
CVS commit: src/usr.bin/indent
Module Name:src Committed By: rillig Date: Sat Nov 27 18:26:48 UTC 2021 Modified Files: src/usr.bin/indent: io.c Log Message: indent: add assertions for input handling Just to document the invariants; the code is already OK. To generate a diff of this commit: cvs rdiff -u -r1.139 -r1.140 src/usr.bin/indent/io.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/tests/fs/vfs
Module Name:src Committed By: gson Date: Sat Nov 27 15:23:33 UTC 2021 Modified Files: src/tests/fs/vfs: t_renamerace.c Log Message: Force failure of the nfs_renamerace_cycle, p2k_ffs_renamerace_cycle, and puffs_renamerace_cycle test cases as they fail only randomly or only on some systems. To generate a diff of this commit: cvs rdiff -u -r1.42 -r1.43 src/tests/fs/vfs/t_renamerace.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tests/fs/vfs/t_renamerace.c diff -u src/tests/fs/vfs/t_renamerace.c:1.42 src/tests/fs/vfs/t_renamerace.c:1.43 --- src/tests/fs/vfs/t_renamerace.c:1.42 Sat Oct 23 17:43:08 2021 +++ src/tests/fs/vfs/t_renamerace.c Sat Nov 27 15:23:33 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: t_renamerace.c,v 1.42 2021/10/23 17:43:08 hannken Exp $ */ +/* $NetBSD: t_renamerace.c,v 1.43 2021/11/27 15:23:33 gson Exp $ */ /* * Modified for rump and atf from a program supplied @@ -253,6 +253,12 @@ renamerace_cycle(const atf_tc_t *tc, con if (FSTYPE_UDF(tc)) atf_tc_fail("PR kern/56253 did not trigger this time"); + if (FSTYPE_P2K_FFS(tc)) + atf_tc_fail("did not fail this time"); + if (FSTYPE_PUFFS(tc)) + atf_tc_fail("did not fail this time"); + if (FSTYPE_NFS(tc)) + atf_tc_fail("did not fail this time"); } ATF_TC_FSAPPLY(renamerace, "rename(2) race with file unlinked mid-operation");
CVS commit: src/tests/fs/vfs
Module Name:src Committed By: gson Date: Sat Nov 27 15:23:33 UTC 2021 Modified Files: src/tests/fs/vfs: t_renamerace.c Log Message: Force failure of the nfs_renamerace_cycle, p2k_ffs_renamerace_cycle, and puffs_renamerace_cycle test cases as they fail only randomly or only on some systems. To generate a diff of this commit: cvs rdiff -u -r1.42 -r1.43 src/tests/fs/vfs/t_renamerace.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/kern
Module Name:src Committed By: riastradh Date: Sat Nov 27 14:11:14 UTC 2021 Modified Files: src/sys/kern: kern_crashme.c Log Message: kern: Add debug.crashme.null_jump. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/sys/kern/kern_crashme.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/kern
Module Name:src Committed By: riastradh Date: Sat Nov 27 14:11:14 UTC 2021 Modified Files: src/sys/kern: kern_crashme.c Log Message: kern: Add debug.crashme.null_jump. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/sys/kern/kern_crashme.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/kern/kern_crashme.c diff -u src/sys/kern/kern_crashme.c:1.4 src/sys/kern/kern_crashme.c:1.5 --- src/sys/kern/kern_crashme.c:1.4 Tue Sep 7 11:00:13 2021 +++ src/sys/kern/kern_crashme.c Sat Nov 27 14:11:14 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: kern_crashme.c,v 1.4 2021/09/07 11:00:13 riastradh Exp $ */ +/* $NetBSD: kern_crashme.c,v 1.5 2021/11/27 14:11:14 riastradh Exp $ */ /* * Copyright (c) 2018, 2019 Matthew R. Green @@ -59,6 +59,7 @@ static int crashme_sysctl_forwarder(SYSC static int crashme_panic(int); static int crashme_null_deref(int); +static int crashme_null_jump(int); #ifdef DDB static int crashme_ddb(int); #endif @@ -73,6 +74,7 @@ static int crashme_ddb(int); static crashme_node nodes[] = { CMNODE("panic", "plain old panic", crashme_panic), CMNODE("null_deref", "null dereference", crashme_null_deref), +CMNODE("null_jump", "jump to null", crashme_null_jump), #ifdef DDB CMNODE("ddb", "enter ddb directly", crashme_ddb), #endif @@ -249,6 +251,16 @@ crashme_null_deref(int flags) return -1; } +static int +crashme_null_jump(int flags) +{ + void (*volatile f)(int) = NULL; + + (*f)(flags); + /* make sure to have a nontrivial return address here */ + return -1; +} + #ifdef DDB static int crashme_ddb(int flags)
CVS commit: src/sys/arch/aarch64/aarch64
Module Name:src Committed By: riastradh Date: Sat Nov 27 14:11:04 UTC 2021 Modified Files: src/sys/arch/aarch64/aarch64: db_trace.c Log Message: aarch64: Fix stack traces from jump-to-null. To generate a diff of this commit: cvs rdiff -u -r1.13 -r1.14 src/sys/arch/aarch64/aarch64/db_trace.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/aarch64/aarch64/db_trace.c diff -u src/sys/arch/aarch64/aarch64/db_trace.c:1.13 src/sys/arch/aarch64/aarch64/db_trace.c:1.14 --- src/sys/arch/aarch64/aarch64/db_trace.c:1.13 Fri Dec 11 18:03:33 2020 +++ src/sys/arch/aarch64/aarch64/db_trace.c Sat Nov 27 14:11:04 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: db_trace.c,v 1.13 2020/12/11 18:03:33 skrll Exp $ */ +/* $NetBSD: db_trace.c,v 1.14 2021/11/27 14:11:04 riastradh Exp $ */ /* * Copyright (c) 2017 Ryo Shimizu @@ -28,7 +28,7 @@ #include -__KERNEL_RCSID(0, "$NetBSD: db_trace.c,v 1.13 2020/12/11 18:03:33 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: db_trace.c,v 1.14 2021/11/27 14:11:04 riastradh Exp $"); #include #include @@ -302,8 +302,21 @@ db_stack_trace_print(db_expr_t addr, boo lastfp = (uint64_t)tf; lastlr = lr; lr = fp = 0; - db_read_bytes((db_addr_t)&tf->tf_pc, sizeof(lr), (char *)&lr); - db_read_bytes((db_addr_t)&tf->tf_reg[29], sizeof(fp), (char *)&fp); + db_read_bytes((db_addr_t)&tf->tf_pc, sizeof(lr), + (char *)&lr); + if (lr == 0) { +/* + * The exception may have been from a + * jump to null, so the null pc we + * would return to is useless. Try + * x[30] instead -- that will be the + * return address for the jump. + */ +db_read_bytes((db_addr_t)&tf->tf_reg[30], +sizeof(lr), (char *)&lr); + } + db_read_bytes((db_addr_t)&tf->tf_reg[29], sizeof(fp), + (char *)&fp); lr = aarch64_strip_pac(lr); /*
CVS commit: src/sys/arch/aarch64/aarch64
Module Name:src Committed By: riastradh Date: Sat Nov 27 14:11:04 UTC 2021 Modified Files: src/sys/arch/aarch64/aarch64: db_trace.c Log Message: aarch64: Fix stack traces from jump-to-null. To generate a diff of this commit: cvs rdiff -u -r1.13 -r1.14 src/sys/arch/aarch64/aarch64/db_trace.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/lib/libc/arch
Module Name:src Committed By: skrll Date: Sat Nov 27 10:00:01 UTC 2021 Modified Files: src/lib/libc/arch/arm/sys: __sigtramp2.S src/lib/libc/arch/powerpc/sys: __sigtramp2.S Log Message: Trailing whitespace To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/lib/libc/arch/arm/sys/__sigtramp2.S cvs rdiff -u -r1.4 -r1.5 src/lib/libc/arch/powerpc/sys/__sigtramp2.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/arch/arm/sys/__sigtramp2.S diff -u src/lib/libc/arch/arm/sys/__sigtramp2.S:1.4 src/lib/libc/arch/arm/sys/__sigtramp2.S:1.5 --- src/lib/libc/arch/arm/sys/__sigtramp2.S:1.4 Tue Nov 23 18:45:53 2021 +++ src/lib/libc/arch/arm/sys/__sigtramp2.S Sat Nov 27 10:00:01 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: __sigtramp2.S,v 1.4 2021/11/23 18:45:53 thorpej Exp $ */ +/* $NetBSD: __sigtramp2.S,v 1.5 2021/11/27 10:00:01 skrll Exp $ */ /*- * Copyright (c) 2002 The NetBSD Foundation, Inc. @@ -67,12 +67,12 @@ .cfi_return_column _REG_R15 CFI_OFFSET(_REG_R15) /* a.k.a. _REG_PC */ -/* +/* * The unwind entry includes the one instruction prior to the trampoline * because the unwinder will look up (return PC - 1) while unwinding. * Normally this would be the jump / branch, but since there isn't one in * this case, we place an explicit nop there instead. - */ + */ nop ENTRY_NP(__sigtramp_siginfo_2) Index: src/lib/libc/arch/powerpc/sys/__sigtramp2.S diff -u src/lib/libc/arch/powerpc/sys/__sigtramp2.S:1.4 src/lib/libc/arch/powerpc/sys/__sigtramp2.S:1.5 --- src/lib/libc/arch/powerpc/sys/__sigtramp2.S:1.4 Sun Nov 21 21:31:24 2021 +++ src/lib/libc/arch/powerpc/sys/__sigtramp2.S Sat Nov 27 10:00:01 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: __sigtramp2.S,v 1.4 2021/11/21 21:31:24 thorpej Exp $ */ +/* $NetBSD: __sigtramp2.S,v 1.5 2021/11/27 10:00:01 skrll Exp $ */ /*- * Copyright (c) 2002 The NetBSD Foundation, Inc. @@ -33,7 +33,7 @@ #include "assym.h" #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: __sigtramp2.S,v 1.4 2021/11/21 21:31:24 thorpej Exp $") +__RCSID("$NetBSD: __sigtramp2.S,v 1.5 2021/11/27 10:00:01 skrll Exp $") #endif /* LIBC_SCCS && !lint */ /* @@ -115,12 +115,12 @@ __RCSID("$NetBSD: __sigtramp2.S,v 1.4 20 .cfi_return_column DWARF_SIGRETURN_REG CFI_OFFSET_DWARF_REG(DWARF_SIGRETURN_REG, _REG_PC) -/* +/* * The unwind entry includes one instruction slot prior to the trampoline * because the unwinder will look up to (return PC - 1 insn) while unwinding. * Normally this would be the jump / branch, but since there isn't one in * this case, we place an explicit nop there instead. - */ + */ nop ENTRY_NOPROFILE(__sigtramp_siginfo_2)
CVS commit: src/lib/libc/arch
Module Name:src Committed By: skrll Date: Sat Nov 27 10:00:01 UTC 2021 Modified Files: src/lib/libc/arch/arm/sys: __sigtramp2.S src/lib/libc/arch/powerpc/sys: __sigtramp2.S Log Message: Trailing whitespace To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/lib/libc/arch/arm/sys/__sigtramp2.S cvs rdiff -u -r1.4 -r1.5 src/lib/libc/arch/powerpc/sys/__sigtramp2.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch/arm/arm
Module Name:src Committed By: skrll Date: Sat Nov 27 08:51:01 UTC 2021 Modified Files: src/sys/arch/arm/arm: cpufunc.c Log Message: Apply some errata workarounds for Cortex A17 To generate a diff of this commit: cvs rdiff -u -r1.182 -r1.183 src/sys/arch/arm/arm/cpufunc.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/arm/arm/cpufunc.c diff -u src/sys/arch/arm/arm/cpufunc.c:1.182 src/sys/arch/arm/arm/cpufunc.c:1.183 --- src/sys/arch/arm/arm/cpufunc.c:1.182 Sat Nov 13 01:48:12 2021 +++ src/sys/arch/arm/arm/cpufunc.c Sat Nov 27 08:51:01 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: cpufunc.c,v 1.182 2021/11/13 01:48:12 jmcneill Exp $ */ +/* $NetBSD: cpufunc.c,v 1.183 2021/11/27 08:51:01 skrll Exp $ */ /* * arm7tdmi support code Copyright (c) 2001 John Fremlin @@ -49,7 +49,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: cpufunc.c,v 1.182 2021/11/13 01:48:12 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: cpufunc.c,v 1.183 2021/11/27 08:51:01 skrll Exp $"); #include "opt_arm_start.h" #include "opt_compat_netbsd.h" @@ -3008,6 +3008,24 @@ armv7_setup(char *args) } else if (CPU_ID_CORTEX_A12_P(lcputype) || CPU_ID_CORTEX_A17_P(lcputype)) { actlr_set = CORTEXA17_ACTLR_SMP; + uint32_t diagset = 0; + const uint16_t varrev = + __SHIFTIN(__SHIFTOUT(lcputype, CPU_ID_VARIANT_MASK), __BITS(7,4)) | + __SHIFTIN(__SHIFTOUT(lcputype, CPU_ID_REVISION_MASK), __BITS(3,0)) | + 0; + /* Errata 852421 exists upto r1p2 */ + if (varrev < 0x12) { + diagset |= __BIT(24); + } + /* Errata 852423 exists upto r1p2 */ + if (varrev < 0x12) { + diagset |= __BIT(12); + } + /* Errata 857272 */ + diagset |= __BITS(11,10); + + const uint32_t dgnctlr1 = armreg_dgnctlr1_read(); + armreg_dgnctlr1_write(dgnctlr1 | diagset); } else if (CPU_ID_CORTEX_A53_P(lcputype)) { } else if (CPU_ID_CORTEX_A57_P(lcputype)) { } else if (CPU_ID_CORTEX_A72_P(lcputype)) {
CVS commit: src/sys/arch/arm/arm
Module Name:src Committed By: skrll Date: Sat Nov 27 08:51:01 UTC 2021 Modified Files: src/sys/arch/arm/arm: cpufunc.c Log Message: Apply some errata workarounds for Cortex A17 To generate a diff of this commit: cvs rdiff -u -r1.182 -r1.183 src/sys/arch/arm/arm/cpufunc.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch/arm/include
Module Name:src Committed By: skrll Date: Sat Nov 27 08:25:18 UTC 2021 Modified Files: src/sys/arch/arm/include: armreg.h Log Message: Add the Cortex A17 Diagnostic control registers To generate a diff of this commit: cvs rdiff -u -r1.133 -r1.134 src/sys/arch/arm/include/armreg.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/arm/include/armreg.h diff -u src/sys/arch/arm/include/armreg.h:1.133 src/sys/arch/arm/include/armreg.h:1.134 --- src/sys/arch/arm/include/armreg.h:1.133 Sat Nov 13 01:48:12 2021 +++ src/sys/arch/arm/include/armreg.h Sat Nov 27 08:25:18 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: armreg.h,v 1.133 2021/11/13 01:48:12 jmcneill Exp $ */ +/* $NetBSD: armreg.h,v 1.134 2021/11/27 08:25:18 skrll Exp $ */ /* * Copyright (c) 1998, 2001 Ben Harris @@ -916,7 +916,16 @@ ARMREG_WRITE64_INLINE(cntv_cval, "p15,3, ARMREG_READ64_INLINE(cntvoff, "p15,4,%Q0,%R0,c14") /* Virtual Offset Register */ ARMREG_WRITE64_INLINE(cntvoff, "p15,4,%Q0,%R0,c14") /* Virtual Offset Register */ /* cp15 c15 registers */ +/* Cortex A17 Diagnostic control registers */ +ARMREG_READ_INLINE(dgnctlr0, "p15,0,%0,c15,c0,0") /* DGNCTLR0 */ +ARMREG_WRITE_INLINE(dgnctlr0, "p15,0,%0,c15,c0,0") /* DGNCTLR0 */ +ARMREG_READ_INLINE(dgnctlr1, "p15,0,%0,c15,c0,1") /* DGNCTLR1 */ +ARMREG_WRITE_INLINE(dgnctlr1, "p15,0,%0,c15,c0,1") /* DGNCTLR1 */ +ARMREG_READ_INLINE(dgnctlr2, "p15,0,%0,c15,c0,2") /* DGNCTLR2 */ +ARMREG_WRITE_INLINE(dgnctlr2, "p15,0,%0,c15,c0,2") /* DGNCTLR2 */ + ARMREG_READ_INLINE(cbar, "p15,4,%0,c15,c0,0") /* Configuration Base Address Register */ + ARMREG_READ_INLINE(pmcrv6, "p15,0,%0,c15,c12,0") /* PMC Control Register (armv6) */ ARMREG_WRITE_INLINE(pmcrv6, "p15,0,%0,c15,c12,0") /* PMC Control Register (armv6) */ ARMREG_READ_INLINE(pmccntrv6, "p15,0,%0,c15,c12,1") /* PMC Cycle Counter (armv6) */
CVS commit: src/sys/arch/arm/include
Module Name:src Committed By: skrll Date: Sat Nov 27 08:25:18 UTC 2021 Modified Files: src/sys/arch/arm/include: armreg.h Log Message: Add the Cortex A17 Diagnostic control registers To generate a diff of this commit: cvs rdiff -u -r1.133 -r1.134 src/sys/arch/arm/include/armreg.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.