public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Nils-Christian Kempke <nils-christian.kempke@intel.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH 11/11] gdb/doc: add section about fortran intrinsic functions and types
Date: Wed, 09 Mar 2022 14:49:09 +0200	[thread overview]
Message-ID: <83y21je1fe.fsf@gnu.org> (raw)
In-Reply-To: <20220309103922.3257803-12-nils-christian.kempke@intel.com> (message from Nils-Christian Kempke via Gdb-patches on Wed, 9 Mar 2022 11:39:22 +0100)

> Date: Wed,  9 Mar 2022 11:39:22 +0100
> From: Nils-Christian Kempke via Gdb-patches <gdb-patches@sourceware.org>
> 
> The earlier version of this document had no sections about the
> available Fortran intrinsic functions or the Fortran builtin types.
> 
> I added two sections 'Fortran intrinsics' and 'Fortran types' to
> document the available Fortran language features.

Thanks, see some comments below, mostly about markup.

> +In Fortran the primitive data-types have an associated KIND type parameter,
> +written as 'TYPE*KINDPARAM', 'TYPE(KIND=KINDPARAM)', or in the
> +@value{GDBN}-only dialect 'TYPE_KINDPARAM'.  A concrete example would be
> +'REAL*4', 'REAL(KIND=4)', and 'REAL_4'.  The kind of a type can be retrieved by
> +using the intrinsic function KIND(), see @ref{Fortran Intrinsics}.

Some of the words you wrote in CAPS are actually meta-syntactic
variables, i.e. they aren't literal symbols, but rather stand for some
symbol.  Those should have the @var markup in Texinfo, and should be
spelled in lower-case letter.  In this case, I think the correct
markup will be this:

  In Fortran the primitive data-types have an associated @code{KIND}
  type parameter, written as @samp{@var{type}*@var{kindparam}},
  @samp{@var{type}(KIND=@var{kindparam})}, or in the @value{GDBN}-only
  dialect @samp{@var{type}_@var{kindparam}}.  A concrete example would
  be @samp{REAL*4}, @samp{REAL(KIND=4)}, and @samp{REAL_4}.  The kind
  of a type can be retrieved by using the intrinsic function @code{KIND},
  see @ref{Fortran Intrinsics}.

The above also fixes other issues with markup:

  . use @samp instead of manual quoting 'like this'
  . use @code{funcname} instead of funcname() to reference to a
    function (the latter looks like a call to the function with no
    arguments, which is not what you meant)

Please make such fixes elsewhere in the patch, there are other such
places.

> +Generally, the actual implementation of the KIND type parameter is compiler
> +specific.  In @value{GDBN} the kind parameter is implemented in accordance to
> +its use in the @sc{gnu} gfortran compiler.  Here, the kind parameter for a
> +given TYPE specifies its size in memory - a Fortran Integer*4 or
> +Integer(kind=4) would be an integer type occupying 4 bytes of
> memory.

Since "Integer*4" and Integer(kind=4) are literal pieces of code
(AFAIU), they should be in @code.

>                                                        An
> +exception to this rule is the COMPLEX type for which the kind of the type
> +does not specify its entire size, but the size of each of the two REAL's it is
> +composed of.  A COMPLEX*4 would thus consist of two REAL*4s and occupy 8 bytes
> +of memory.

Same here with the other data types.

> +note, that the @sc{gnu} default types can actually be changed by compiler flags
> +such as '-fdefault-integer-8' and '-fdefault-real-8'.

Instead of quoting command-line options by hand, please use the
@option markup.

> +Computes the absolut value of its operand A.  Currently not supported for
                ^^^^^^^
Typo: should be "absolute".  Also, I thing "argument" is better than
"operand" here.

"A" should be @var{a}, according to the same methodology as explained
above.

> +@item ALLOCATE(ARRAY)
> +Returns whether ARRAY is allocated or not.

@var{array}

> +@item ASSOCIATED(POINTER [, TARGET])
> +Returns the association status of the pointer POINTER or if TARGET is present
> +whether POINTER is associated with the target TARGET.

POINTER and TARGET should b @var{pointer} and @var{target}.

Same in other similar situations in your patch.

> +@item CMPLX(X [, Y [, KIND]])
> +Returns a complex number where X is converted to the real component.  If Y is
> +present it is converted to the imaginary component.  If Y is not present then
> +the imaginary component is set to 0.0 except if X itself is of COMPLEX type.
> +The optional parameter KIND specifies the kind of the return type
> +COMPLEX(KIND).

"0.0" should be in @code.

  reply	other threads:[~2022-03-09 12:49 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-09 10:39 [PATCH 00/11] Improve Fortran intrinsic types and procedures Nils-Christian Kempke
2022-03-09 10:39 ` [PATCH 01/11] gdb/f-lang: add Integer*1 to Fortran builtin types Nils-Christian Kempke
2022-04-07 14:28   ` Tom Tromey
2022-03-09 10:39 ` [PATCH 02/11] gdb/f-lang: remove hidden ^L characters Nils-Christian Kempke
2022-04-07 14:28   ` Tom Tromey
2022-03-09 10:39 ` [PATCH 03/11] gdb/fortran: fix complex type in Fortran builtin types Nils-Christian Kempke
2022-04-07 14:30   ` Tom Tromey
2022-03-09 10:39 ` [PATCH 04/11] gdb/fortran: reformat build_fortran_types in f-lang.c Nils-Christian Kempke
2022-04-07 14:30   ` Tom Tromey
2022-03-09 10:39 ` [PATCH 05/11] gdb/fortran: change default logical type to builtin_logical Nils-Christian Kempke
2022-04-07 14:32   ` Tom Tromey
2022-03-09 10:39 ` [PATCH 06/11] gdb/fortran: clean-up Fortran intrinsic types Nils-Christian Kempke
2022-04-07 14:33   ` Tom Tromey
2022-03-09 10:39 ` [PATCH 07/11] gdb/fortran: Change GDB print for fortran default types Nils-Christian Kempke
2022-04-07 14:37   ` Tom Tromey
2022-03-09 10:39 ` [PATCH 08/11] gdb/fortran: rename f77_keywords to f_keywords Nils-Christian Kempke
2022-04-07 14:37   ` Tom Tromey
2022-03-09 10:39 ` [PATCH 09/11] gdb/fortran: rewrite intrinsic handling and add some missing overloads Nils-Christian Kempke
2022-04-07 14:49   ` Tom Tromey
2022-04-08 12:49     ` Kempke, Nils-Christian
2022-04-13  5:14   ` Tom de Vries
2022-04-20 16:10     ` Kempke, Nils-Christian
2022-03-09 10:39 ` [PATCH 10/11] gdb/fortran/testsuite: add complex from integers test Nils-Christian Kempke
2022-04-07 14:49   ` Tom Tromey
2022-04-07 14:50   ` Tom Tromey
2022-03-09 10:39 ` [PATCH 11/11] gdb/doc: add section about fortran intrinsic functions and types Nils-Christian Kempke
2022-03-09 12:49   ` Eli Zaretskii [this message]
2022-03-09 17:01     ` Kempke, Nils-Christian

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=83y21je1fe.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=gdb-patches@sourceware.org \
    --cc=nils-christian.kempke@intel.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).