public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Sandra Loosemore <sandra.loosemore@siemens.com>
To: Jakub Jelinek <jakub@redhat.com>
Cc: Gerald Pfeifer <gerald@pfeifer.com>,
	Joseph Myers <joseph@codesourcery.com>,
	Sandra Loosemore <sandra@codesourcery.com>,
	gcc-patches@gcc.gnu.org
Subject: Re: [PATCH] extend.texi: Fix up defbuiltin* with spaces in return type
Date: Fri, 1 Dec 2023 10:43:57 -0700	[thread overview]
Message-ID: <c850fd36-eba2-7e3c-002b-4dc4e525147f@siemens.com> (raw)
In-Reply-To: <ZWoY1ErbB5cUrjow@tucnak>

On 12/1/23 10:33, Jakub Jelinek wrote:
> On Fri, Dec 01, 2023 at 10:04:38AM -0700, Sandra Loosemore wrote:
>> Thanks, this looks good to me.  I think I also noticed this weird formatting
>> in passing recently when I was looking for something else and did not have
>> time to track it down myself.
> 
> There is another question.  In many cases we just specify types for the
> builtin arguments, in other cases types and names with @var{name} syntax,
> and in other case with just name.
> 
> @defbuiltin{int __builtin_fpclassify (int, int, int, int, int, ...)}
> vs.
> @defbuiltin{size_t __builtin_object_size (const void * @var{ptr}, int @var{type})}
> vs.
> @defbuiltinx{bool __builtin_umull_overflow (unsigned long int a, unsigned long int b, unsigned long int *res)}
> and in some cases even just name the arguments and don't specify type:
> @defbuiltin{void __builtin_clear_padding (@var{ptr})}
> @defbuiltin{@var{type} __builtin_choose_expr (@var{const_exp}, @var{exp1}, @var{exp2})}
> 
> Shall we tweak that somehow?  If the argument names are unimportant, perhaps
> it is fine to leave that out, but shouldn't we always use @var{...} around
> the parameter names when specified?

Yup.  The Texinfo manual says:  "When using @deftypefn command and variations, 
you should mark parameter names with @var to distinguish these from data type 
names, keywords, and other parts of the literal syntax of the programming 
language."

> And avoid leaving out the types, use something like
> __builtin_clear_padding (@var{type} *@var{ptr})
> or
> __builtin_choose_expr (@var{type1} @var{const_exp}, @var{type2} @var{exp1}, @var{type3} @var{exp2})
> ?

That would probably be good too.

-Sandra




  reply	other threads:[~2023-12-01 17:44 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-01 10:26 Jakub Jelinek
2023-12-01 15:07 ` Jeff Law
2023-12-01 17:04 ` Sandra Loosemore
2023-12-01 17:33   ` Jakub Jelinek
2023-12-01 17:43     ` Sandra Loosemore [this message]
2023-12-04  7:36       ` [PATCH] extend.texi: Mark builtin arguments with @var{...} Jakub Jelinek
2023-12-11  1:48         ` Sandra Loosemore

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=c850fd36-eba2-7e3c-002b-4dc4e525147f@siemens.com \
    --to=sandra.loosemore@siemens.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=gerald@pfeifer.com \
    --cc=jakub@redhat.com \
    --cc=joseph@codesourcery.com \
    --cc=sandra@codesourcery.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).