bug-make
[Top][All Lists]
Advanced

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

Handling references to invalid variables


From: Paul Smith
Subject: Handling references to invalid variables
Date: Mon, 20 Feb 2023 14:11:19 -0500
User-agent: Evolution 3.46.4 (by Flathub.org)

In the next major release (not the upcoming 4.4.1 release but the one
after that) I plan to implement notifying users of invalid variable
references; for example variable names containing whitespace.

So, a makefile like this for example:

  all: ; echo $(cat foo)

will notify the user about the illegal variable reference "cat foo",
instead if silently expanding to the empty string.

My intent is that this is always enabled, not requiring an extra option
like --warn-undefined-variables, since it's never legal to have a
variable name containing whitespace.

The question is, should this notification be a warning?  Or should it
be a fatal error?  Originally I thought it should be fatal but now I'm
leaning towards making it a warning, at least for a release or two,
because I worry about makefiles that might have these references that
are silently and innocuously expanding to empty strings, suddenly stop
working completely.



reply via email to

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