head 1.6; access; symbols netbsd-11-0-RC4:1.6 netbsd-11-0-RC3:1.6 netbsd-11-0-RC2:1.6 netbsd-11-0-RC1:1.6 perseant-exfatfs-base-20250801:1.6 netbsd-11:1.6.0.2 netbsd-11-base:1.6 netbsd-10-1-RELEASE:1.2 perseant-exfatfs-base-20240630:1.4 perseant-exfatfs:1.4.0.2 perseant-exfatfs-base:1.4 netbsd-10-0-RELEASE:1.2 netbsd-10-0-RC6:1.2 netbsd-10-0-RC5:1.2 netbsd-10-0-RC4:1.2 netbsd-10-0-RC3:1.2 netbsd-10-0-RC2:1.2 netbsd-10-0-RC1:1.2 netbsd-10:1.2.0.2 netbsd-10-base:1.2; locks; strict; comment @# @; 1.6 date 2025.03.30.09.51.50; author rillig; state Exp; branches; next 1.5; commitid veGmSzVhPiW2G4PF; 1.5 date 2024.07.04.17.47.54; author rillig; state Exp; branches; next 1.4; commitid mjDGVMgldk7QYxgF; 1.4 date 2023.06.01.20.56.35; author rillig; state Exp; branches 1.4.2.1; next 1.3; commitid j3tIvMRlxolKQhrE; 1.3 date 2023.06.01.06.25.34; author rillig; state Exp; branches; next 1.2; commitid hnMqo2NMChIH2drE; 1.2 date 2022.09.03.00.50.07; author rillig; state Exp; branches; next 1.1; commitid Ly5rHWQCQfpTNlSD; 1.1 date 2022.09.02.16.24.31; author sjg; state Exp; branches; next ; commitid jGjIPgPolZIk6jSD; 1.4.2.1 date 2025.08.02.05.58.33; author perseant; state Exp; branches; next ; commitid 23j6GFaDws3O875G; desc @@ 1.6 log @make: use '"filename" line 123' for locations instead of 'filename:123' The format 'filename:123' is commonly used for identifying a location in a file. Text editors recognize it and allow quick navigation through it. The previous format was specific to make and would have required custom support in editors. The new format was already used in stack traces, except for the first line. Now all lines use the same format. @ text @make: directive-for-break.mk:45: break outside of for loop make: directive-for-break.mk:65: The .break directive does not take arguments in .for loop from directive-for-break.mk:63 with i = 1 make: Fatal errors encountered -- cannot continue make: stopped in unit-tests exit status 1 @ 1.5 log @make: add more context information to error messages In case of a parse error or evaluation error, print the variable value in addition to the variable name, to see the effects of previous expression modifiers. In nested make calls, print the current directory at the bottom of a stack trace, as that information is otherwise hard to get in a parallel build spanning multiple directories. @ text @d1 2 a2 2 make: "directive-for-break.mk" line 45: break outside of for loop make: "directive-for-break.mk" line 65: The .break directive does not take arguments @ 1.4 log @tests/make: force line-based diagnostics to be listed in the tests This way, contradictions between the intended output and the actual output are closer together and have a better chance of being spotted. @ text @d3 1 @ 1.4.2.1 log @Sync with HEAD @ text @d1 2 a2 3 make: directive-for-break.mk:45: break outside of for loop make: directive-for-break.mk:65: The .break directive does not take arguments in .for loop from directive-for-break.mk:63 with i = 1 @ 1.3 log @make: error out on a .break directive with arguments @ text @d1 2 a2 2 make: "directive-for-break.mk" line 47: break outside of for loop make: "directive-for-break.mk" line 67: The .break directive does not take arguments @ 1.2 log @make: clean up handling of .break in .for loops Move For_Break further up, as the functions in that file are sorted from small to big. The cast from size_t to unsigned int is required by lint. In parse.c, move the code into a separate function to keep ParseDirective small. Its only job is to parse the directive and then delegate to another function doing the actual work. In the manual page, remove empty lines. In the test, ensure that .break stops processing of the .for loop immediately; anything after the .break is not processed anymore. Replace ':=' with '=', as there is no need to evaluate '$i' early. Check the expected value in the .mk file instead of the .exp file, to keep the reading scope as small as possible. @ text @d1 2 a2 1 make: "directive-for-break.mk" line 45: break outside of for loop @ 1.1 log @make: add .break to terminate .for loop early When .break is encountered within a .for loop it causes immediate termination. Outside of a .for loop .break causes a parse error. Reviewed by: christos @ text @d1 1 a1 2 make: "directive-for-break.mk" line 16: I=3 make: "directive-for-break.mk" line 24: break outside of for loop @