| @@ -1,19 +1,22 @@ | | | @@ -1,19 +1,22 @@ |
1 | # $NetBSD: lint.mk,v 1.3 2020/09/15 16:22:04 rillig Exp $ | | 1 | # $NetBSD: lint.mk,v 1.4 2021/01/30 13:50:18 rillig Exp $ |
2 | # | | 2 | # |
3 | # Demonstrates stricter checks that are only enabled in the lint mode, | | 3 | # Demonstrates stricter checks that are only enabled in lint mode, using the |
4 | # using the -dL option. | | 4 | # option -dL. |
5 | | | 5 | |
6 | # Ouch: as of 2020-08-03, make exits successfully even though the error | | 6 | # Before main.c 1.421 from 2020-11-01, make exited successfully even though |
7 | # message has been issued as PARSE_FATAL. | | 7 | # the error message had been issued as PARSE_FATAL. This was because back |
| | | 8 | # then, make checked for parse errors only after parsing each top-level |
| | | 9 | # makefile, in Parse_File. After that, when expanding variable expressions |
| | | 10 | # in shell commands, the parse errors were not checked again. |
8 | | | 11 | |
9 | # Ouch: as of 2020-08-03, the variable is malformed and parsing stops | | 12 | # Ouch: as of 2020-08-03, the variable is malformed and parsing stops |
10 | # for a moment, but is continued after the wrongly-guessed end of the | | 13 | # for a moment, but is continued after the wrongly-guessed end of the |
11 | # variable, which echoes "y@:Q}". | | 14 | # variable, which echoes "y@:Q}". |
12 | | | 15 | |
13 | .MAKEFLAGS: -dL | | 16 | .MAKEFLAGS: -dL |
14 | | | 17 | |
15 | all: mod-loop-varname | | 18 | all: mod-loop-varname |
16 | | | 19 | |
17 | mod-loop-varname: | | 20 | mod-loop-varname: |
18 | @echo ${VAR:Uvalue:@${:Ubar:S,b,v,}@x${var}y@:Q} | | 21 | @echo ${VAR:Uvalue:@${:Ubar:S,b,v,}@x${var}y@:Q} |
19 | @echo ${VAR:Uvalue:@!@x$!y@:Q} # surprisingly allowed | | 22 | @echo ${VAR:Uvalue:@!@x$!y@:Q} # surprisingly allowed |