public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Gabriel Dos Reis <gdr@integrable-solutions.net>
To: Martin Wodok <m.wodok@osb-ag.de>
Cc: gcc-help@gcc.gnu.org
Subject: Re: C++: No Warning for passing value > 255 as parameter to a function requiring "unsigned char"
Date: Tue, 26 Jul 2005 21:54:00 -0000	[thread overview]
Message-ID: <m3mzo944me.fsf@uniton.integrable-solutions.net> (raw)
In-Reply-To: <200507261115.45744.m.wodok@osb-ag.de>

Martin Wodok <m.wodok@osb-ag.de> writes:

| Hi Gaby
| hi Eljay,
| 
| thanks for your answer!
| 
| > Martin Wodok <m.wodok@osb-ag.de> writes:
| > | Assigning 1000 is of course out of bounds for "unsigned char", thus the
| >
| > No, it is not.  Unsigned integer types are modulo types; it is no overflow.
| 
| Yes, they're modulo types, that's why this is NOT an error,

The argument was that it makes sense to issue a warning when the the
code is dubious -- not just an error.  However, in this case, modulo
arithmetic for unsigned int is a characteristic propery.
Consequently, it does not make much sense to warn about it.

-- Gaby

  parent reply	other threads:[~2005-07-26 21:54 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-07-22 13:51 Martin Wodok
2005-07-22 14:47 ` Gabriel Dos Reis
2005-07-26  9:36   ` Martin Wodok
2005-07-26 14:28     ` Eljay Love-Jensen
2005-07-26 21:54     ` Gabriel Dos Reis [this message]
2005-07-27  0:44       ` Sisyphus
2005-07-22 15:22 ` Eljay Love-Jensen
2005-07-22 15:24   ` Eljay Love-Jensen

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=m3mzo944me.fsf@uniton.integrable-solutions.net \
    --to=gdr@integrable-solutions.net \
    --cc=gcc-help@gcc.gnu.org \
    --cc=m.wodok@osb-ag.de \
    /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).