delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2003/07/27/19:45:10

Message-ID: <3F246120.63C3753C@worldnet.att.net>
From: Paul Cousoulis <paulcsouls AT worldnet DOT att DOT net>
X-Mailer: Mozilla 4.78 [en] (Win95; U)
X-Accept-Language: en
MIME-Version: 1.0
Newsgroups: comp.os.msdos.djgpp
Subject: integer overflow
Lines: 9
Date: Sun, 27 Jul 2003 23:33:21 GMT
NNTP-Posting-Host: 12.81.74.220
X-Complaints-To: abuse AT worldnet DOT att DOT net
X-Trace: bgtnsc04-news.ops.worldnet.att.net 1059348801 12.81.74.220 (Sun, 27 Jul 2003 23:33:21 GMT)
NNTP-Posting-Date: Sun, 27 Jul 2003 23:33:21 GMT
Organization: AT&T Worldnet
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Why does this code result in an integer overflow?

unsigned long res;

res = (1<<31)-1;

Thanks
Paul

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019