[bug #51267] Improve error handling after a special command

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[bug #51267] Improve error handling after a special command

Robert Morell
URL:
  <http://savannah.gnu.org/bugs/?51267>

                 Summary: Improve error handling after a special command
                 Project: make
            Submitted by: elfring
            Submitted on: Mon 19 Jun 2017 06:08:34 PM CEST
                Severity: 3 - Normal
              Item Group: Bug
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any
       Component Version: 4.2.1
        Operating System: Any
           Fixed Release: None
           Triage Status: None

    _______________________________________________________

Details:

I have noticed the following code fragment in a recipe which is mentioned in
the section “Generating prerequisites automatically” of the
documentation.
https://www.gnu.org/software/make/manual/html_node/Automatic-Prerequisites.html#index-make-depend


         $(CC) -M $(CPPFLAGS) $< > $@.$$$$; \


The semicolon indicates at the end that the return value is ignored there. I
imagine that further data processing should usually only be performed if this
command succeeded.
Would you like to improve the exception handling for such a situation?




    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?51267>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/


_______________________________________________
Bug-make mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/bug-make
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [bug #51267] Improve error handling after a special command

Henrik Carlqvist
On Mon, 19 Jun 2017 12:08:35 -0400 (EDT)
Markus Elfring <[hidden email]> wrote:
> The semicolon indicates at the end that the return value is ignored
> there. I imagine that further data processing should usually only be
> performed if this command succeeded.
> Would you like to improve the exception handling for such a situation?

If you really think that is a bug you should file that bug to the writers
of the shell. Make calls commands in a shell and the result is as in the
shell.

Try the following at your shell prompt:

true && echo everything is fine
echo $?
false && echo evertyhing is fine
echo $?
false ; echo everything is fine
echo $?

regards Henrik

_______________________________________________
Bug-make mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/bug-make
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [bug #51267] Improve error handling after a special command

Paul Smith-20
On Mon, 2017-06-19 at 19:45 +0200, Henrik Carlqvist wrote:

> On Mon, 19 Jun 2017 12:08:35 -0400 (EDT)
> Markus Elfring <[hidden email]> wrote:
> > The semicolon indicates at the end that the return value is ignored
> > there. I imagine that further data processing should usually only
> > be performed if this command succeeded.
> > Would you like to improve the exception handling for such a
> > situation?
>
> If you really think that is a bug you should file that bug to the
> writers of the shell. Make calls commands in a shell and the result
> is as in the shell.

I think Markus is suggesting that the example in the documentation be
improved to not have this problem regarding losing the return value.

That's probably a good idea, although this entire method of managing
automatically generated dependencies is essentially obsolete.  Arguably this entire section should be rewritten from scratch to use more modern methods.

_______________________________________________
Bug-make mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/bug-make
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[bug #51267] Improve error handling after a special command

Robert Morell
In reply to this post by Robert Morell
Update of bug #51267 (project make):

              Item Group:                     Bug => Documentation          


    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?51267>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/


_______________________________________________
Bug-make mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/bug-make
Loading...