public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Tom de Vries <tdevries@suse.de>
To: Tom Tromey <tom@tromey.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH] [gdb/build] Fix adding -DNDEBUG to python flags of release build
Date: Fri, 1 Dec 2023 07:25:38 +0100	[thread overview]
Message-ID: <81289926-2cea-4fb9-8577-7401ddeb3cd7@suse.de> (raw)
In-Reply-To: <874jh3cab0.fsf@tromey.com>

On 11/30/23 20:26, Tom Tromey wrote:
>>>>>> "Tom" == Tom de Vries <tdevries@suse.de> writes:
> 
> Tom> [ This was not obvious to me, but apparently evaluating an empty or undefined
> Tom> variable in this context is similar to using ':' or 'true', so the line is
> Tom> evaluated as:
> 
> TIL.
> 
> Tom> [ Unfortunately, the move might introduce issues similar to the one we're
> Tom> fixing, and I'm not sure how to check for this.  Shellcheck doesn't detect
> Tom> this type of problem.  FWIW, I did run shellcheck (using arguments -xa, in the
> Tom> src/gdb directory to make sure ../bfd/development.sh is taken into account)
> Tom> before and after and observed that the number of lines/words/chars in the
> Tom> shellcheck output is identical. ]
> 
> I don't think there's a good way to figure this out.  It's one of the
> problems with autoconf.
> 

There are cases where variables are either empty/undefined, or "yes", 
say variable GCC.

But this is one of the cases we know that the variable needs to be 
defined, so we can do something like:
...
+empty_var ()
+{
+    echo "EMPTY VAR, EXITING"
+    exit 1
+}
...

And then rewrite all references to use ${development:-empty_var}.

Then we can rewrite the GCC cases to be defined as either yes or no, and 
treat likewise.

Sounds like a major task though, and also cumbersome to maintain without 
any automation that warns you if you've added an unprotected variable 
reference.

Thanks,
- Tom

> If we do discover an issue, we may have to split the macro in two; or
> perhaps move more code into it.
> 
> Anyway I think this is ok.
> Approved-By: Tom Tromey <tom@tromey.com>
> 
> 
> Tom


  reply	other threads:[~2023-12-01  6:25 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-30 11:21 Tom de Vries
2023-11-30 19:26 ` Tom Tromey
2023-12-01  6:25   ` Tom de Vries [this message]
  -- strict thread matches above, loose matches on Subject: below --
2023-11-30 11:16 Tom de Vries

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=81289926-2cea-4fb9-8577-7401ddeb3cd7@suse.de \
    --to=tdevries@suse.de \
    --cc=gdb-patches@sourceware.org \
    --cc=tom@tromey.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).