Source-Changes-HG archive

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

[src/trunk]: src/bin/sh sh: ignore lint error about 'continue' in 'do while' ...



details:   https://anonhg.NetBSD.org/src/rev/17106bda67e3
branches:  trunk
changeset: 989014:17106bda67e3
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sat Oct 09 21:02:53 2021 +0000

description:
sh: ignore lint error about 'continue' in 'do while' loop

exec.c(575): error: continue in 'do ... while (0)' loop [323]
jobs.c(203): error: continue in 'do ... while (0)' loop [323]

It is certainly a rarely used feature, I saw it the first time today and
had to look up its meaning in the C standard. But after that, I don't
see why a 'continue' statement in a 'do while' loop should be an error.
Maybe a warning since up to now I thought that 'continue' would jump
back to the top of the loop, while it really jumps to the bottom of the
loop body, for all 3 kinds of loops.

diffstat:

 bin/sh/Makefile |  3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diffs (17 lines):

diff -r c35e96d17a2b -r 17106bda67e3 bin/sh/Makefile
--- a/bin/sh/Makefile   Sat Oct 09 20:59:47 2021 +0000
+++ b/bin/sh/Makefile   Sat Oct 09 21:02:53 2021 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.117 2021/08/15 11:57:17 christos Exp $
+#      $NetBSD: Makefile,v 1.118 2021/10/09 21:02:53 rillig Exp $
 #      @(#)Makefile    8.4 (Berkeley) 5/5/95
 
 .include <bsd.own.mk>
@@ -30,6 +30,7 @@
 #COPTS+=-g
 #CFLAGS+=-funsigned-char
 #TARGET_CHARFLAG?= -DTARGET_CHAR="unsigned char" -funsigned-char
+#LINTFLAGS+=   -X 323          # continue in 'do ... while (0)' loop
 
 # Reproducible build parameters ... export into sh for NETBSD_SHELL setting
 .if ${MKREPRO_TIMESTAMP:Uno} != "no"



Home | Main Index | Thread Index | Old Index