public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "schwab@linux-m68k.org" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug exp/13122] Get wrong value when do a digital computing
Date: Tue, 23 Aug 2011 19:33:00 -0000	[thread overview]
Message-ID: <bug-13122-4717-ODmzBD1KAq@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-13122-4717@http.sourceware.org/bugzilla/>

http://sourceware.org/bugzilla/show_bug.cgi?id=13122

--- Comment #1 from Andreas Schwab <schwab@linux-m68k.org> 2011-08-23 14:47:46 UTC ---
$ echo '#include <stdio.h>
int x = (1314109286*1000000000+216493710)-(1314109272*1000000000+53467812);    
int main (void) { printf ("%d\n", x); }' | gcc -xc -
<stdin>:2:20: warning: integer overflow in expression [-Woverflow]
<stdin>:2:54: warning: integer overflow in expression [-Woverflow]
$ ./a.out 
1278124010

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


  reply	other threads:[~2011-08-23 14:48 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-23 14:48 [Bug exp/13122] New: " teawater at gmail dot com
2011-08-23 19:33 ` schwab@linux-m68k.org [this message]
2012-02-06 15:21 ` [Bug exp/13122] " tromey at redhat dot com

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=bug-13122-4717-ODmzBD1KAq@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=gdb-prs@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).