public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Richard Bunt <richard.bunt@linaro.org>
To: Tom Tromey <tromey@adacore.com>,
	Richard Bunt via Gdb-patches <gdb-patches@sourceware.org>
Subject: Re: [PATCH v2] gdb/fortran: Align intrinsic/variable precedence
Date: Thu, 3 Aug 2023 14:21:30 +0100	[thread overview]
Message-ID: <6c6e719e-ffe0-2fed-f0ef-35f61d8679af@linaro.org> (raw)
In-Reply-To: <87zg39e540.fsf@tromey.com>



On 02/08/2023 18:17, Tom Tromey wrote:
>>>>>> "Richard" == Richard Bunt via Gdb-patches <gdb-patches@sourceware.org> writes:
> 
> Richard> Fortran allows variables and function to be named after language defined
> Richard> intrinsics as they are not reserved keywords. For example, the abs maths
> Richard> intrinsic can be hidden by a user declaring a variable called abs.
> 
> Thank you for the patch.
> 
> Richard> +static const struct token f_intrinsics[] =
> Richard> +{
> Richard> +    /* This is post the symbol search as symbols can hide intrinsics.  Also,
> Richard> +       give Fortran intrinsics priority over C symbols.  This prevents
> Richard> +       non-Fortran symbols from hiding intrinsics, for example abs.  */
> Richard> +    if (!result.symbol || result.symbol->language () != language_fortran)
> Richard> +      for (int i = 0; i < ARRAY_SIZE (f_intrinsics); i++)
> Richard> +	{
> 
> I think it's better to use foreach here, as is done for f_keywords:
> 
>    for (const auto &keyword : f_keywords)
>       ...
> 

Thank you for the review. Posted a v3 with this modification.

> Otherwise this looks good, thank you.
> 
> Tom

Rich.

      reply	other threads:[~2023-08-03 13:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-02 13:36 Richard Bunt
2023-08-02 17:17 ` Tom Tromey
2023-08-03 13:21   ` Richard Bunt [this message]

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=6c6e719e-ffe0-2fed-f0ef-35f61d8679af@linaro.org \
    --to=richard.bunt@linaro.org \
    --cc=gdb-patches@sourceware.org \
    --cc=tromey@adacore.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).