[cmake-developers] [PATCH] remove "x" placeholder from STREQUAL operands

Rolf Eike Beer eike at sf-mail.de
Fri Apr 18 08:58:18 EDT 2014


Brad King wrote:
> On 04/18/2014 03:07 AM, Rolf Eike Beer wrote:
> > what about nuking at least all
> > control characters and whitespace from variable names in 3.1? I don't
> > think
> > that anyone has used them on purpose, and accidentially using them will
> > only cause trouble.
> 
> If we're going to change this I don't want it to be part-way.  We've
> discussed before on this list that the proper solution is to make
> auto-expansion and keyword recognition occur only for unquoted args
> (with associated policy of course).

To forbid whitespace and control characters in variable names can IMHO only be 
good. It would at least catch obvious errors because one hit the space bar 
accidentially while typing the variable name, which could happen easily when 
you are trying to compose the variable name from other variables:

set("${var} ${foo}" "some${var}")

So, yes, this new stricter variable naming could be "abused" as a better 
workaround for the unwanted expansion. But I find it useful even without that 
usecase. And while at it I suggest we forbid any of ${}() in variable names 
also, since using them can only cause trouble. And maybe even everything non-
ASCII, too.

> There is nothing wrong with the "x" workaround in practice until
> a real solution can be implemented.

Right.

Eike
-- 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20140418/9beb0cd0/attachment-0002.sig>


More information about the cmake-developers mailing list