xref: /freebsd/contrib/bmake/unit-tests/lint.mk (revision dba7b0ef928af88caa38728a73657b837aeeac93)
1*dba7b0efSSimon J. Gerraty# $NetBSD: lint.mk,v 1.4 2021/01/30 13:50:18 rillig Exp $
22c3632d1SSimon J. Gerraty#
3*dba7b0efSSimon J. Gerraty# Demonstrates stricter checks that are only enabled in lint mode, using the
4*dba7b0efSSimon J. Gerraty# option -dL.
52c3632d1SSimon J. Gerraty
6*dba7b0efSSimon J. Gerraty# Before main.c 1.421 from 2020-11-01, make exited successfully even though
7*dba7b0efSSimon J. Gerraty# the error message had been issued as PARSE_FATAL.  This was because back
8*dba7b0efSSimon J. Gerraty# then, make checked for parse errors only after parsing each top-level
9*dba7b0efSSimon J. Gerraty# makefile, in Parse_File.  After that, when expanding variable expressions
10*dba7b0efSSimon J. Gerraty# in shell commands, the parse errors were not checked again.
112c3632d1SSimon J. Gerraty
122c3632d1SSimon J. Gerraty# Ouch: as of 2020-08-03, the variable is malformed and parsing stops
132c3632d1SSimon J. Gerraty# for a moment, but is continued after the wrongly-guessed end of the
142c3632d1SSimon J. Gerraty# variable, which echoes "y@:Q}".
152c3632d1SSimon J. Gerraty
16956e45f6SSimon J. Gerraty.MAKEFLAGS: -dL
17956e45f6SSimon J. Gerraty
182c3632d1SSimon J. Gerratyall: mod-loop-varname
192c3632d1SSimon J. Gerraty
202c3632d1SSimon J. Gerratymod-loop-varname:
212c3632d1SSimon J. Gerraty	@echo ${VAR:Uvalue:@${:Ubar:S,b,v,}@x${var}y@:Q}
222c3632d1SSimon J. Gerraty	@echo ${VAR:Uvalue:@!@x$!y@:Q}	# surprisingly allowed
23