public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] doc: Fix up return type of __builtin_va_arg_pack_len [PR108560]
@ 2023-01-27  9:09 Jakub Jelinek
  2023-01-27  9:59 ` Richard Biener
  0 siblings, 1 reply; 2+ messages in thread
From: Jakub Jelinek @ 2023-01-27  9:09 UTC (permalink / raw)
  To: Richard Biener; +Cc: gcc-patches

Hi!

__builtin_va_arg_pack_len as implemented returned int since its introduction
in 2007.  The initial documentation didn't mention any return type,
which changed in 2010 in r0-103077-gab940b73bfabe2cec4 during some
documentation formatting cleanups
https://gcc.gnu.org/legacy-ml/gcc-patches/2010-09/msg01632.html
I can understand that for formatting some type was needed there
but what exactly hasn't been really discussed.

So, I think we should change documentation to match the implementation,
rather than change implementation to match the documentation.
Most people don't use more than 2147483647 arguments to inline functions,
and on poor targets with 16-bit ints I bet even having more than 65535
arguments to inline functions would be highly unexpected.

Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?

2023-01-27  Jakub Jelinek  <jakub@redhat.com>

	PR other/108560
	* doc/extend.texi: Fix up return type of __builtin_va_arg_pack_len
	from size_t to int.

--- gcc/doc/extend.texi.jj	2023-01-24 11:10:13.218075138 +0100
+++ gcc/doc/extend.texi	2023-01-26 17:13:47.428496682 +0100
@@ -688,7 +688,7 @@ myprintf (FILE *f, const char *format, .
 @end smallexample
 @end deftypefn
 
-@deftypefn {Built-in Function} {size_t} __builtin_va_arg_pack_len ()
+@deftypefn {Built-in Function} {int} __builtin_va_arg_pack_len ()
 This built-in function returns the number of anonymous arguments of
 an inline function.  It can be used only in inline functions that
 are always inlined, never compiled as a separate function, such

	Jakub


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] doc: Fix up return type of __builtin_va_arg_pack_len [PR108560]
  2023-01-27  9:09 [PATCH] doc: Fix up return type of __builtin_va_arg_pack_len [PR108560] Jakub Jelinek
@ 2023-01-27  9:59 ` Richard Biener
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Biener @ 2023-01-27  9:59 UTC (permalink / raw)
  To: Jakub Jelinek; +Cc: gcc-patches

On Fri, 27 Jan 2023, Jakub Jelinek wrote:

> Hi!
> 
> __builtin_va_arg_pack_len as implemented returned int since its introduction
> in 2007.  The initial documentation didn't mention any return type,
> which changed in 2010 in r0-103077-gab940b73bfabe2cec4 during some
> documentation formatting cleanups
> https://gcc.gnu.org/legacy-ml/gcc-patches/2010-09/msg01632.html
> I can understand that for formatting some type was needed there
> but what exactly hasn't been really discussed.
> 
> So, I think we should change documentation to match the implementation,
> rather than change implementation to match the documentation.
> Most people don't use more than 2147483647 arguments to inline functions,
> and on poor targets with 16-bit ints I bet even having more than 65535
> arguments to inline functions would be highly unexpected.

Agreed.

> Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?

OK.

> 2023-01-27  Jakub Jelinek  <jakub@redhat.com>
> 
> 	PR other/108560
> 	* doc/extend.texi: Fix up return type of __builtin_va_arg_pack_len
> 	from size_t to int.
> 
> --- gcc/doc/extend.texi.jj	2023-01-24 11:10:13.218075138 +0100
> +++ gcc/doc/extend.texi	2023-01-26 17:13:47.428496682 +0100
> @@ -688,7 +688,7 @@ myprintf (FILE *f, const char *format, .
>  @end smallexample
>  @end deftypefn
>  
> -@deftypefn {Built-in Function} {size_t} __builtin_va_arg_pack_len ()
> +@deftypefn {Built-in Function} {int} __builtin_va_arg_pack_len ()
>  This built-in function returns the number of anonymous arguments of
>  an inline function.  It can be used only in inline functions that
>  are always inlined, never compiled as a separate function, such
> 
> 	Jakub
> 
> 

-- 
Richard Biener <rguenther@suse.de>
SUSE Software Solutions Germany GmbH, Frankenstrasse 146, 90461 Nuernberg,
Germany; GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman;
HRB 36809 (AG Nuernberg)

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-01-27  9:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-27  9:09 [PATCH] doc: Fix up return type of __builtin_va_arg_pack_len [PR108560] Jakub Jelinek
2023-01-27  9:59 ` Richard Biener

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).