Re: [PATCH] stdio-common: Remove do … while condition from printf_positional

Andreas Schwab <[email protected]>
Newsgroups gmane.comp.lib.glibc.alpha
Message-ID <[email protected]>
On Aug 10 2026, Florian Weimer wrote:

> The condition is misleading because it is never evaluated.
>
> ---
>  stdio-common/vfprintf-internal.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/stdio-common/vfprintf-internal.c b/stdio-common/vfprintf-internal.c
> index 14ac0d9762..a3bf411520 100644
> --- a/stdio-common/vfprintf-internal.c
> +++ b/stdio-common/vfprintf-internal.c
> @@ -1415,7 +1415,8 @@ printf_positional (struct Xprintf_buffer * buf, const CHAR_T *format,
>  	  }
>  	  break;
>  	}
> -      while (Xprintf_buffer_has_failed (buf));
> +      /* Used to make the break statements above work.  */
> +      while (0);

It could be changed back to while (1) { ... } like it was when
printf_positional was introduced initially (until this dead condition
was added).

-- 
Andreas Schwab, SUSE Labs, [email protected]
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.