public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Paul Eggert <eggert@cs.ucla.edu>
To: Alejandro Colomar <alx.manpages@gmail.com>,
	Wilco Dijkstra <Wilco.Dijkstra@arm.com>,
	Adhemerval Zanella <adhemerval.zanella@linaro.org>
Cc: 'GNU C Library' <libc-alpha@sourceware.org>
Subject: Re: [RFC] roundup.3: New page documenting roundup(3) (was: bug in roundup(3) from <sys/param.h>)
Date: Tue, 17 Jan 2023 13:53:44 -0800	[thread overview]
Message-ID: <a3f2e4ce-f431-e05c-d040-3eec0abc7ee1@cs.ucla.edu> (raw)
In-Reply-To: <d4d5892a-a2dc-832e-72ad-a9a84bdc853a@gmail.com>

On 1/17/23 12:24, Alejandro Colomar wrote:
> 
>         This  macro  produces  incorrect values when x + step would 
> overflow or
>         wrap around

The macro can have undefined behavior on overflow, if the result type is 
signed. So I suggest replacing "produces incorrect values" with "has 
undefined behavior".

I suppose you could also document that the behavior is well-defined if 
the result type is unsigned, but that sounds like overkill.

  reply	other threads:[~2023-01-17 21:53 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-17 19:16 bug in roundup(3) from <sys/param.h> Wilco Dijkstra
2023-01-17 19:50 ` Alejandro Colomar
2023-01-17 20:11 ` Paul Eggert
2023-01-17 20:13   ` Alejandro Colomar
2023-01-17 20:24     ` [RFC] roundup.3: New page documenting roundup(3) (was: bug in roundup(3) from <sys/param.h>) Alejandro Colomar
2023-01-17 21:53       ` Paul Eggert [this message]
2023-01-17 22:29         ` Alejandro Colomar

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=a3f2e4ce-f431-e05c-d040-3eec0abc7ee1@cs.ucla.edu \
    --to=eggert@cs.ucla.edu \
    --cc=Wilco.Dijkstra@arm.com \
    --cc=adhemerval.zanella@linaro.org \
    --cc=alx.manpages@gmail.com \
    --cc=libc-alpha@sourceware.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).