public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Kees Cook <keescook@chromium.org>
To: Martin Uecker <ma.uecker@gmail.com>
Cc: gcc@gcc.gnu.org
Subject: Re: Question on -fwrapv and -fwrapv-pointer
Date: Sat, 23 Sep 2023 21:00:16 -0700	[thread overview]
Message-ID: <202309232056.3235206E@keescook> (raw)
In-Reply-To: <902dc33093f80f0ad6200a3aa2c69982cfb880a8.camel@gmail.com>

On Wed, Sep 20, 2023 at 11:16:21PM +0200, Martin Uecker wrote:
> I meant something else: Why wasn't an unsigned type
> used in the first place?   If all "counter" variables were
> signed and all "modulo" variables unsigned, one could already 
> diagnose overflow reliably. 
> 
> I was trying to understand if there are generally
> valid reasons for using unsigned integers for "counters".
> or whether this is just a historical mistake in the
> kernel.

There isn't a common guideline in the kernel coding style for this, so
it's mostly arbitrary. :(

> (and thank you for your explanations)

Sure thing! Thanks for your (and everyone's) help clarifying this whole
area. :)

-Kees

-- 
Kees Cook

      reply	other threads:[~2023-09-24  4:00 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <202309151107.C2F7D9A01@keescook>
2023-09-16  8:36 ` Martin Uecker
2023-09-18  7:31   ` Richard Biener
2023-09-18  8:17     ` Martin Uecker
2023-09-18  8:47       ` Richard Biener
2023-09-18 15:22         ` Martin Uecker
2023-09-18 15:27     ` Andrew Pinski
2023-09-20 20:40   ` Kees Cook
2023-09-20 21:16     ` Martin Uecker
2023-09-24  4:00       ` Kees Cook [this message]

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=202309232056.3235206E@keescook \
    --to=keescook@chromium.org \
    --cc=gcc@gcc.gnu.org \
    --cc=ma.uecker@gmail.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).