This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: gcc 2.95.2-151 / 32-bit integers



----- Original Message -----
From: "John Ruff" <jruff@nc.rr.com>
To: <gcc-bugs@gcc.gnu.org>
Sent: Saturday, June 02, 2001 4:46 PM
Subject: gcc 2.95.2-151 / 32-bit integers


> GNU:
>
> I understand that when compliing C++ source code where a 'int' has
been
> defined and that integer's variable has been giving a value greater
than
> (+/-)2,147,483,647 such as 9,999,999,999 then that value should be
> wrapped around and equal 1,410,065,407.  This works with gcc-2.8.1,
and
> when complied produces only a warning.  However, when complied with
> gcc-2.95.2, an error is produced and the compilation aborts abnormally
> with an exit status 1.
>
> System Info:
> Linux 2.2.18 / gcc 2.95.2-151
>
> Below is a simple example:
>
> //-------------------test.cpp---------------
> #include <iostream.h>
>
> void main()
> {
>   int number;
>   number = 9999999999;
>   cout << "The integer number= " << number << endl;
> }
> //------------------end-------------------
>
> If there is a patch or newer version I should install please let me
know.
>
>
> Thanks in advance,
>
> John Ruff
> jruff@nc.rr.com
>
If you want defined wrap-around behavior you must employ casts to make
sure everything is done unsigned.  gcc is intended to be a C compiler.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]