All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nikolai Merinov <n.merinov@inango-systems.com>
To: peter kjellerstedt <peter.kjellerstedt@axis.com>
Cc: bitbake-devel@lists.openembedded.org
Subject: Re: [bitbake-devel] [PATCH] parse: Forbid ambiguous assignments to ${.}, ${+}, and ${:} variables
Date: Tue, 4 Feb 2025 13:11:21 +0200 (IST)	[thread overview]
Message-ID: <1954040712.15183.1738667481426.JavaMail.zimbra@inango-systems.com> (raw)
In-Reply-To: <DB5PR02MB10213AFB411A607B11EAB0B62EFE82@DB5PR02MB10213.eurprd02.prod.outlook.com>

Hi Peter,

> The above made me ponder on the existence of $, { and } in the regular
> expression for the variable name and what that can be (ab)used for. I
> realized that it allows you do define really odd variables such as:
> 
> ${} = "foobar"
> } = "foobar"
> $ = "foobar"
> 
> And while you cannot access them directly using, e.g., "${$}", you can
> access them using, e.g., "${@d.getVar('$')"...
> 
> This also allows defining variables that do not match the syntax at all,
> e.g.:
> 
> EQUAL = "="
> ${EQUAL} = "bar"
> 
> which will define the variable "=" and where "${@d.getVar('=')}" then
> returns "bar" as expected...
> 
> I am not sure this is a problem or working as intended, but it is a bit
> odd.

I did not aware of bitbake development history, but I believe that there
can be only one reason to do it: Makefile allow same kind of bizarre things. 

    $ cat Makefile 
    name = ==არ გააკეთო==
    $(name) = Hello World
    all: ; echo $(==არ გააკეთო==)
    $ make
    echo Hello World
    Hello World
    $

Regards,
Nikolai



  parent reply	other threads:[~2025-02-04 11:11 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-29 18:55 [PATCH] parse: Forbid ambiguous assignments to ${.}, ${+}, and ${:} variables Nikolai Merinov
2025-01-31 20:40 ` [bitbake-devel] " Peter Kjellerstedt
2025-02-03 17:42   ` Richard Purdie
2025-02-04 11:11   ` Nikolai Merinov [this message]
2025-02-01 13:29 ` Richard Purdie
2025-02-03 16:42   ` Nikolai Merinov
2025-02-03 17:40     ` Richard Purdie
2025-02-04  7:13       ` Nikolai Merinov
2025-02-04  7:13         ` [PATCH v3 1/1] " Nikolai Merinov
2025-02-03 16:42   ` [PATCH v2] " Nikolai Merinov
2025-02-03 17:39     ` Richard Purdie

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1954040712.15183.1738667481426.JavaMail.zimbra@inango-systems.com \
    --to=n.merinov@inango-systems.com \
    --cc=bitbake-devel@lists.openembedded.org \
    --cc=peter.kjellerstedt@axis.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.