]> git.ipfire.org Git - thirdparty/make.git/commitdiff
* job.c (child_error): Modify error message string.
authorPaul Smith <psmith@gnu.org>
Sat, 28 Oct 2017 22:45:30 +0000 (18:45 -0400)
committerPaul Smith <psmith@gnu.org>
Mon, 30 Oct 2017 21:07:21 +0000 (17:07 -0400)
Ensure Emacs compile-mode's next-error doesn't match target failure
messages.  Syntax errors in makefiles are still matched.

12 files changed:
job.c
tests/scripts/features/errors
tests/scripts/features/include
tests/scripts/features/output-sync
tests/scripts/features/parallelism
tests/scripts/features/patternrules
tests/scripts/features/vpathplus
tests/scripts/misc/general3
tests/scripts/options/dash-k
tests/scripts/targets/DELETE_ON_ERROR
tests/scripts/targets/POSIX
tests/scripts/variables/SHELL

diff --git a/job.c b/job.c
index 80e63d257dd8b9245943b00a45699a4df4c239d3..5ad2b7f045794fc946c5ee13ee9d4d6e9997a616 100644 (file)
--- a/job.c
+++ b/job.c
@@ -553,8 +553,11 @@ child_error (struct child *child,
     nm = _("<builtin>");
   else
     {
-      char *a = alloca (strlen (flocp->filenm) + 1 + 11 + 1);
-      sprintf (a, "%s:%lu", flocp->filenm, flocp->lineno + flocp->offset);
+      /* We can't use the standard <FILE>:<LINENO> syntax here because
+         Emacs misinterprets it and matches a bogus filename in the compile
+         buffer.  */
+      char *a = alloca (strlen (flocp->filenm) + 6 + INTSTR_LENGTH + 1);
+      sprintf (a, "%s;%lu", flocp->filenm, flocp->lineno + flocp->offset);
       nm = a;
     }
 
index ebd43831b4e2249694c581959aaa1616aba68b35..5c570790a6d0268de48d142c2f30c0d540531927 100644 (file)
@@ -50,7 +50,7 @@ $delete_error_code = $? >> 8;
 
 $answer = "$rm_command cleanit
 $cleanit_error
-$make_name: [$makefile:2: clean] Error $delete_error_code (ignored)
+$make_name: [$makefile;2: clean] Error $delete_error_code (ignored)
 $rm_command foo\n";
 
 &run_make_with_options($makefile,"",&get_logfile);
@@ -77,7 +77,7 @@ if (!$vos)
 
 $answer = "$rm_command cleanit
 $cleanit_error
-$make_name: [$makefile:5: clean2] Error $delete_error_code (ignored)
+$make_name: [$makefile;5: clean2] Error $delete_error_code (ignored)
 $rm_command foo\n";
 
 &run_make_with_options($makefile,"clean2 -i",&get_logfile);
@@ -98,7 +98,7 @@ all:
        @echo there
        @exit 1
 !,
-              '', "hi\nthere\n#MAKE#: *** [#MAKEFILE#:5: all] Error 1", 512);
+              '', "hi\nthere\n#MAKE#: *** [#MAKEFILE#;5: all] Error 1", 512);
 
 1;
 
index 0c63c067bc656c12db2d99a77776a20929488487..3df5af0b42613387e04dee8afc7bee24f76864b5 100644 (file)
@@ -221,7 +221,7 @@ include inc1
 inc1: foo; echo > $@
 foo:; exit 1
 !,
-                  '', "exit 1\n#MAKEFILE#:3: inc1: $ERR_no_such_file\n#MAKE#: *** [#MAKEFILE#:5: foo] Error 1\n", 512);
+                  '', "exit 1\n#MAKEFILE#:3: inc1: $ERR_no_such_file\n#MAKE#: *** [#MAKEFILE#;5: foo] Error 1\n", 512);
 
     rmfiles('inc1');
 
index 914b381e50c6e5870142313439a9b37e69d0428b..1407e81a9dcaf62d0c1e1c64bcf33dc39022cbeb 100644 (file)
@@ -206,9 +206,9 @@ bar: end
 #MAKE#[1]: Entering directory '#PWD#/foo'
 foo-fail: start
 foo-fail: end
-#MAKE#[1]: *** [Makefile:23: foo-fail] Error 1
+#MAKE#[1]: *** [Makefile;23: foo-fail] Error 1
 #MAKE#[1]: Leaving directory '#PWD#/foo'
-#MAKE#: *** [#MAKEFILE#:4: make-foo-fail] Error 2\n",
+#MAKE#: *** [#MAKEFILE#;4: make-foo-fail] Error 2\n",
 512);
 
 # Test the per-job synchronization.
@@ -326,7 +326,7 @@ run_make_test(qq!
 all: t1
 t1: ; -\@\$(MAKE) -f $m1
 !,
-              "-j -Oline", "#MAKE#[1]: Entering directory '#PWD#'\nd1 stderr\nd1 stdout\n$m1:3: *** d1 failed.  Stop.\n#MAKE#[1]: Leaving directory '#PWD#'\n#MAKE#: [#MAKEFILE#:3: t1] Error 2 (ignored)\n");
+              "-j -Oline", "#MAKE#[1]: Entering directory '#PWD#'\nd1 stderr\nd1 stdout\n$m1:3: *** d1 failed.  Stop.\n#MAKE#[1]: Leaving directory '#PWD#'\n#MAKE#: [#MAKEFILE#;3: t1] Error 2 (ignored)\n");
 
 rmfiles($m1);
 
@@ -343,7 +343,7 @@ if ($port_type ne 'W32') {
     run_make_test(q!
 all:: ; @./foo bar baz
 !,
-              '-O', "#MAKE#: ./foo: Command not found\n#MAKE#: *** [#MAKEFILE#:2: all] Error 127\n", 512);
+              '-O', "#MAKE#: ./foo: Command not found\n#MAKE#: *** [#MAKEFILE#;2: all] Error 127\n", 512);
 }
 
 # This tells the test driver that the perl test script executed properly.
index fabe5485c61f0630b9e3dc70eceaaf3adaf5f7a3..b12532d68b19fe913c72b9b5e808349b60ad5667 100644 (file)
@@ -99,12 +99,12 @@ ok:
        \@$sleep_command 4
        \@echo Ok done",
               '-rR -j5', "Fail
-#MAKE#: *** [#MAKEFILE#:8: fail.1] Error 1
+#MAKE#: *** [#MAKEFILE#;8: fail.1] Error 1
 #MAKE#: *** Waiting for unfinished jobs....
 Fail
-#MAKE#: *** [#MAKEFILE#:8: fail.2] Error 1
+#MAKE#: *** [#MAKEFILE#;8: fail.2] Error 1
 Fail
-#MAKE#: *** [#MAKEFILE#:8: fail.3] Error 1
+#MAKE#: *** [#MAKEFILE#;8: fail.3] Error 1
 Ok done",
              512);
 
index 8f7ccc408f08b571cfccad456c48b36046a29e29..f76724eba07155c285d4407c692da25031828a64 100644 (file)
@@ -110,7 +110,7 @@ $(dir)/foo.bar:
 
 ',
 "dir=$dir",
-"#MAKE#: *** [#MAKEFILE#:6: $dir/foo.bar] Error 1",
+"#MAKE#: *** [#MAKEFILE#;6: $dir/foo.bar] Error 1",
 512);
 
 unlink("$dir/foo.bar");
index b48571716cf818ee5d3dc6b9e815b135629413a2..8e723fed2905be00b633cec362a2a1d624b311ee 100644 (file)
@@ -83,7 +83,7 @@ cat ${VP}foo.c bar.c > foo.b 2>/dev/null || exit 1
 
 $answer = "not creating notarget.c from notarget.d
 cat notarget.c > notarget.b 2>/dev/null || exit 1
-$make_name: *** [$makefile:13: notarget.b] Error 1
+$make_name: *** [$makefile;13: notarget.b] Error 1
 ";
 
 &compare_output($answer,&get_logfile(1));
index 7bbff1c2c7b08403fcc917222d084730602043fb..da9263a2560b2a96ede6cfdd74ed995cd0f743ff 100644 (file)
@@ -310,6 +310,6 @@ foo     bar
 hi
 foo     bar');
 
-run_make_test('x:;@-exit 1', '', "#MAKE#: [#MAKEFILE#:1: x] Error 1 (ignored)\n");
+run_make_test('x:;@-exit 1', '', "#MAKE#: [#MAKEFILE#;1: x] Error 1 (ignored)\n");
 
 1;
index cd78e7f00ae8238113797fa5a439532f8ffd5463..247432749e2836f9c4acd5eb0d8fde183cccc5a7 100644 (file)
@@ -92,7 +92,7 @@ close(MAKEFILE);
 &run_make_with_options($makefile2, "-k", &get_logfile, $error_code);
 
 $answer = "exit 1
-$make_name: *** [$makefile2:9: foo.o] Error 1
+$make_name: *** [$makefile2;9: foo.o] Error 1
 $make_name: Target 'all' not remade because of errors.\n";
 
 &compare_output($answer, &get_logfile(1));
index f0d9f9b4d63fa61fe288c8c6e63205a81963ffa3..6d60287ea6466ceb4c382749a0756e5f99bdd4a2 100644 (file)
@@ -8,7 +8,7 @@ run_make_test('
 .DELETE_ON_ERROR:
 all: ; exit 1 > $@
 ',
-              '', "exit 1 > all\n#MAKE#: *** [#MAKEFILE#:3: all] Error 1\n#MAKE#: *** Deleting file 'all'", 512);
+              '', "exit 1 > all\n#MAKE#: *** [#MAKEFILE#;3: all] Error 1\n#MAKE#: *** Deleting file 'all'", 512);
 
 run_make_test('
 .DELETE_ON_ERROR:
@@ -16,7 +16,7 @@ all: foo.x ;
 %.x : %.q ; echo > $@
 %.q : ; exit 1 > $@
 ',
-              '', "exit 1 > foo.q\n#MAKE#: *** [#MAKEFILE#:5: foo.q] Error 1\n#MAKE#: *** Deleting file 'foo.q'", 512);
+              '', "exit 1 > foo.q\n#MAKE#: *** [#MAKEFILE#;5: foo.q] Error 1\n#MAKE#: *** Deleting file 'foo.q'", 512);
 
 # This tells the test driver that the perl test script executed properly.
 1;
index c44cc500111e76896a4343084fa70fbb2aa38a2d..b547e4911a4a8b6b2f3d713332bf14ed4a213a98 100644 (file)
@@ -17,7 +17,7 @@ run_make_test(qq!
 .POSIX:
 all: ; \@$script
 !,
-              '', "#MAKE#: *** [#MAKEFILE#:3: all] Error $err\n", 512);
+              '', "#MAKE#: *** [#MAKEFILE#;3: all] Error $err\n", 512);
 
 # User settings must override .POSIX
 $flags = '-xc';
index 3cf6cee4d0f3915eeaa6b3e32e683e0f2a9b762a..503b96e721d41978cd663b5239fe611efff1169e 100644 (file)
@@ -102,6 +102,6 @@ run_make_test(qq!
 .SHELLFLAGS = $flags
 all: ; \@$script
 !,
-              '', "$out#MAKE#: *** [#MAKEFILE#:3: all] Error $err\n", 512);
+              '', "$out#MAKE#: *** [#MAKEFILE#;3: all] Error $err\n", 512);
 
 1;