From: Tom Tromey <tromey@adacore.com>
To: Richard Bunt via Gdb-patches <gdb-patches@sourceware.org>
Cc: Richard Bunt <richard.bunt@linaro.org>
Subject: Re: [PATCH v2] gdb/fortran: Align intrinsic/variable precedence
Date: Wed, 02 Aug 2023 11:17:19 -0600 [thread overview]
Message-ID: <87zg39e540.fsf@tromey.com> (raw)
In-Reply-To: <20230802133613.941743-1-richard.bunt@linaro.org> (Richard Bunt via Gdb-patches's message of "Wed, 2 Aug 2023 14:36:13 +0100")
>>>>> "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)
...
Otherwise this looks good, thank you.
Tom
next prev parent reply other threads:[~2023-08-02 17:17 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 [this message]
2023-08-03 13:21 ` Richard Bunt
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=87zg39e540.fsf@tromey.com \
--to=tromey@adacore.com \
--cc=gdb-patches@sourceware.org \
--cc=richard.bunt@linaro.org \
/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).