public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/18460] New: -2147483648 not considered an "int"
@ 2004-11-13 10:45 jens dot maurer at gmx dot net
  2004-11-13 10:47 ` [Bug c++/18460] " jens dot maurer at gmx dot net
  2004-11-13 13:41 ` schwab at suse dot de
  0 siblings, 2 replies; 3+ messages in thread
From: jens dot maurer at gmx dot net @ 2004-11-13 10:45 UTC (permalink / raw)
  To: gcc-bugs

Compiling

const int n = -2147483648;

results in the warning

minus-max.cc:1: warning: this decimal constant is unsigned only in ISO C90

which is wrong: The constant is exactly -2^31, which fits into a (32 bit) int,
thus no automatic conversions to larger types should occur.

-- 
           Summary: -2147483648 not considered an "int"
           Product: gcc
           Version: 3.4.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jens dot maurer at gmx dot net
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18460


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug c++/18460] -2147483648 not considered an "int"
  2004-11-13 10:45 [Bug c++/18460] New: -2147483648 not considered an "int" jens dot maurer at gmx dot net
@ 2004-11-13 10:47 ` jens dot maurer at gmx dot net
  2004-11-13 13:41 ` schwab at suse dot de
  1 sibling, 0 replies; 3+ messages in thread
From: jens dot maurer at gmx dot net @ 2004-11-13 10:47 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |niemayer at isg dot de


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18460


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug c++/18460] -2147483648 not considered an "int"
  2004-11-13 10:45 [Bug c++/18460] New: -2147483648 not considered an "int" jens dot maurer at gmx dot net
  2004-11-13 10:47 ` [Bug c++/18460] " jens dot maurer at gmx dot net
@ 2004-11-13 13:41 ` schwab at suse dot de
  1 sibling, 0 replies; 3+ messages in thread
From: schwab at suse dot de @ 2004-11-13 13:41 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From schwab at suse dot de  2004-11-13 13:41 -------
There are no negative constants/literals in C and C++.  2147483648 is not 
representable in (32-bit) int or long, so its type is unsigned in C90, but in 
C++98 the behaviour is undefined. 

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |INVALID


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18460


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2004-11-13 13:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-11-13 10:45 [Bug c++/18460] New: -2147483648 not considered an "int" jens dot maurer at gmx dot net
2004-11-13 10:47 ` [Bug c++/18460] " jens dot maurer at gmx dot net
2004-11-13 13:41 ` schwab at suse dot de

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).