Sat Oct 9 21:02:53 2021 UTC ()
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.


(rillig)
diff -r1.117 -r1.118 src/bin/sh/Makefile

cvs diff -r1.117 -r1.118 src/bin/sh/Makefile (expand / switch to unified diff)

--- src/bin/sh/Makefile 2021/08/15 11:57:17 1.117
+++ src/bin/sh/Makefile 2021/10/09 21:02:53 1.118
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1# $NetBSD: Makefile,v 1.117 2021/08/15 11:57:17 christos Exp $ 1# $NetBSD: Makefile,v 1.118 2021/10/09 21:02:53 rillig Exp $
2# @(#)Makefile 8.4 (Berkeley) 5/5/95 2# @(#)Makefile 8.4 (Berkeley) 5/5/95
3 3
4.include <bsd.own.mk> 4.include <bsd.own.mk>
5 5
6PROG= sh 6PROG= sh
7SHSRCS= alias.c arith_token.c arithmetic.c cd.c echo.c error.c eval.c exec.c \ 7SHSRCS= alias.c arith_token.c arithmetic.c cd.c echo.c error.c eval.c exec.c \
8 expand.c histedit.c input.c jobs.c mail.c main.c memalloc.c \ 8 expand.c histedit.c input.c jobs.c mail.c main.c memalloc.c \
9 miscbltin.c mystring.c options.c parser.c redir.c show.c trap.c \ 9 miscbltin.c mystring.c options.c parser.c redir.c show.c trap.c \
10 output.c var.c test.c kill.c syntax.c 10 output.c var.c test.c kill.c syntax.c
11GENSRCS=builtins.c init.c nodes.c 11GENSRCS=builtins.c init.c nodes.c
12GENHDRS=builtins.h nodes.h token.h nodenames.h optinit.h 12GENHDRS=builtins.h nodes.h token.h nodenames.h optinit.h
13SRCS= ${SHSRCS} ${GENSRCS} 13SRCS= ${SHSRCS} ${GENSRCS}
14 14
@@ -20,26 +20,27 @@ DPADD+= ${LIBEDIT} ${LIBTERMINFO} @@ -20,26 +20,27 @@ DPADD+= ${LIBEDIT} ${LIBTERMINFO}
20# Environment for scripts executed during build. 20# Environment for scripts executed during build.
21SCRIPT_ENV= \ 21SCRIPT_ENV= \
22 AWK=${TOOL_AWK:Q} \ 22 AWK=${TOOL_AWK:Q} \
23 MKTEMP=${TOOL_MKTEMP:Q} \ 23 MKTEMP=${TOOL_MKTEMP:Q} \
24 SED=${TOOL_SED:Q} 24 SED=${TOOL_SED:Q}
25 25
26CPPFLAGS+=-DSHELL -I. -I${.CURDIR} -I${NETBSDSRCDIR}/lib/libedit 26CPPFLAGS+=-DSHELL -I. -I${.CURDIR} -I${NETBSDSRCDIR}/lib/libedit
27CPPFLAGS+= -DUSE_LRAND48 27CPPFLAGS+= -DUSE_LRAND48
28#XXX: For testing only. 28#XXX: For testing only.
29#CPPFLAGS+=-DDEBUG=1 29#CPPFLAGS+=-DDEBUG=1
30#COPTS+=-g 30#COPTS+=-g
31#CFLAGS+=-funsigned-char 31#CFLAGS+=-funsigned-char
32#TARGET_CHARFLAG?= -DTARGET_CHAR="unsigned char" -funsigned-char 32#TARGET_CHARFLAG?= -DTARGET_CHAR="unsigned char" -funsigned-char
 33#LINTFLAGS+= -X 323 # continue in 'do ... while (0)' loop
33 34
34# Reproducible build parameters ... export into sh for NETBSD_SHELL setting 35# Reproducible build parameters ... export into sh for NETBSD_SHELL setting
35.if ${MKREPRO_TIMESTAMP:Uno} != "no" 36.if ${MKREPRO_TIMESTAMP:Uno} != "no"
36BUILD_DATE!= ${TOOL_DATE} -u -r "${MKREPRO_TIMESTAMP}" "+%Y%m%d%H%M%S" 37BUILD_DATE!= ${TOOL_DATE} -u -r "${MKREPRO_TIMESTAMP}" "+%Y%m%d%H%M%S"
37# These are (should be) equivalent, but the 2nd is easier to understand 38# These are (should be) equivalent, but the 2nd is easier to understand
38#CPPFLAGS+= -DBUILD_DATE='"${BUILD_DATE:C/([^0]0?)(00)*$/\1/}Z"' 39#CPPFLAGS+= -DBUILD_DATE='"${BUILD_DATE:C/([^0]0?)(00)*$/\1/}Z"'
39CPPFLAGS+= -DBUILD_DATE='"${BUILD_DATE:S/00$//:S/00$//:S/00$//}Z"' 40CPPFLAGS+= -DBUILD_DATE='"${BUILD_DATE:S/00$//:S/00$//:S/00$//}Z"'
40.endif 41.endif
41 42
42.ifdef SMALLPROG 43.ifdef SMALLPROG
43CPPFLAGS+=-DSMALL 44CPPFLAGS+=-DSMALL
44.endif 45.endif
45.ifdef TINYPROG 46.ifdef TINYPROG