On Sat, 2026-05-16 at 21:43 +0800, Dan Jacobson wrote: > Say, make needs a '--warn-redefined-variables' option. > https://unix.stackexchange.com/questions/806006/how-to-emulate-some-future-make-warn-redefined-variables/ > > In fact, not only just warn, optionally quit with an error.
Do you have ideas on how this would behave? I think it would be far too annoying to ever enable in real life... or else it wouldn't really have much effect. Would it warn if you override an empty variable? What if you override a recursive variable assignment with a simple variable assignment, as in https://make.mad-scientist.net/deferred-simple-variable-expansion/ ? Would it warn if a variable was set in the makefile that overrode a variable inherited from the environment? Would it warn if a variable was set on the command line that override a variable in the makefile? What about a make command that was invoked as a recursive make invocation? Would it warn if a target-specific variable overrides a global variable? -- Paul D. Smith <[email protected]> Find some GNU Make tips at: https://www.gnu.org http://make.mad-scientist.net "Please remain calm...I may be mad, but I am a professional." --Mad Scientist
