public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jonathan Wakely <jwakely.gcc@gmail.com>
To: Florian Weimer <fweimer@redhat.com>
Cc: Jonny Grant <jg@jguk.org>, gcc-help <gcc-help@gcc.gnu.org>
Subject: Re: shift-count-overflow possible issue on 64bit type
Date: Mon, 25 Nov 2019 12:22:00 -0000	[thread overview]
Message-ID: <CAH6eHdS7yd-buUmLUhrhkWwZ5LObzrUkbdBu-zyYN8j=GM7s7g@mail.gmail.com> (raw)
In-Reply-To: <87eexwi1yb.fsf@oldenburg2.str.redhat.com>

On Mon, 25 Nov 2019 at 12:18, Florian Weimer wrote:
>
> * Jonathan Wakely:
>
> > Why do you expect a different result for these?
> >
> > A small = 1 << 40;
> > B big = 1 << 40;
> >
> > In both cases the expression is 1 << 40, the type of A or B is irrelevant.
>
> Some languages define integer literals in such a way that they have
> types which do not exist at run time and evaluate constant expressions
> with infinite precision.

Yes, but C and C++ do not do that. Understanding the language you're
programming in is important.

      reply	other threads:[~2019-11-25 12:22 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-23 13:56 Jonny Grant
2019-11-23 14:16 ` Ponnuvel Palaniyappan
2019-11-24  1:15   ` Jonny Grant
2019-11-25  9:30 ` Jonathan Wakely
2019-11-25 12:02   ` Cristiano Di Buduo
2019-11-26 12:41     ` Jonny Grant
2019-11-25 12:18   ` Florian Weimer
2019-11-25 12:22     ` Jonathan Wakely [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='CAH6eHdS7yd-buUmLUhrhkWwZ5LObzrUkbdBu-zyYN8j=GM7s7g@mail.gmail.com' \
    --to=jwakely.gcc@gmail.com \
    --cc=fweimer@redhat.com \
    --cc=gcc-help@gcc.gnu.org \
    --cc=jg@jguk.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).