[Top][All Lists]

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

RE: Handling references to invalid variables

From: rsbecker
Subject: RE: Handling references to invalid variables
Date: Mon, 20 Feb 2023 14:20:39 -0500

On February 20, 2023 2:11 PM, Paul Smith wrote:
>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 
>undefined-variables, since it's never legal to have a variable name containing
>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 
>have these references that are silently and innocuously expanding to empty 
>suddenly stop working completely.

Having worked on (insert large number) of build engines, there are likely users 
who depend on bad or empty strings behaving in a particular way (prior to this 
feature). I like your idea of turning this detection on by default from a 
personal standpoint; however, I think you need to be able to return to a 
compatible mode for some users. Having an option like 
--undefined-variables=warn or --undefined-variables=error (the default) or 
--undefined-variables=ignore would be prudent.

Just my $0.02

Brief whoami: NonStop&UNIX developer since approximately
-- In real life, I talk too much.

reply via email to

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