[Bug c/35427] pointer subtraction in very big array

2008-03-03 Thread akr at m17n dot org
--- Comment #4 from akr at m17n dot org 2008-03-04 00:17 --- The result can be representable by ptrdiff_t because the result is number of longs. The array is bit larger than 2**31 bytes. So the result is bit larger than 2**29. It is representable in signed. -- http://gcc.gnu.org/bu

[Bug c/35427] pointer subtraction in very big array

2008-03-03 Thread pinskia at gcc dot gnu dot org
--- Comment #3 from pinskia at gcc dot gnu dot org 2008-03-03 23:57 --- ptrdiff_t is defined as a signed type so is the subtraction of two pointer types. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35427

[Bug c/35427] pointer subtraction in very big array

2008-03-03 Thread akr at m17n dot org
--- Comment #2 from akr at m17n dot org 2008-03-03 23:45 --- (In reply to comment #1) > nelem*sizeof(long) > > Wraps so what do you expect? This is the correct behavior really. Oops. It wrapped. But changing the type of nelem to size_t doesn't change the situation. nelem * sizeof(l

[Bug c/35427] pointer subtraction in very big array

2008-03-03 Thread pinskia at gcc dot gnu dot org
--- Comment #1 from pinskia at gcc dot gnu dot org 2008-03-03 17:49 --- nelem*sizeof(long) Wraps so what do you expect? This is the correct behavior really. -- pinskia at gcc dot gnu dot org changed: What|Removed |Added --