bug-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Add .ALL_WARNINGS_FATAL special target


From: 積丹尼 Dan Jacobson
Subject: Add .ALL_WARNINGS_FATAL special target
Date: Fri, 29 Dec 2017 10:41:27 +0800

In (info "(make) Error Messages")

'warning: overriding recipe for target `XXX''
'warning: ignoring old recipe for target `XXX''
     GNU 'make' allows only one recipe to be specified per target
     (except for double-colon rules).  If you give a recipe for a target
     which already has been defined to have one, this warning is issued
     and the second recipe will overwrite the first.  *Note Multiple
     Rules for One Target: Multiple Rules.

That is all well and good but often the user has
m:; something good
and then way down at the bottom of a Makefile
m:; something bad
that he didn't remember.

Well doing
$ make
which had been doing the default of using the first rule all day, now
suddenly digs way down and grabs this old rule and prints a warning and
executes it no matter what.
There not being even a perl-like
use strict;
use warnings FATAL => q(all);
that one can put at the top of a Makefile to stop it.

Let's look at the work flow again. Programmer Johnny all day has been
stacking new things in his Makefile and then just doing
$ make
each time.

$ cat Makefile
m:; bla bla #put here at 8:31
g:; bla bla #put here at 8:27
...
s:; bla bla #put here at 8:11
d:; bla bla #put here at 8:07
m:; bla bla #put here at 8:01

He didn't realize he reused letter m, and wham, instead of politely just
using the first m, causing not a blip on the radar for Johnny, (except
for a warning) it suddenly digs way down to the last m.

OK I'm not saying any of that should be changed...

Hmmm, nothing in (info "(make) Errors") to help me with this mere
warning.

Ah! In
(info "(make) Special Targets")
the closest one finds is
'.DELETE_ON_ERROR'

Therefore please add a new
'.ALL_WARNINGS_FATAL'
or something (that we error prone careless
programmers can use, just like we put
use warnings FATAL => q(all);
in all perl files we write today,)
or make it the default, and instead add a
'.NO_WARNINGS_FATAL'
for non-careless programmers.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]