This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/13421] IA32 bigmem pointer subtraction and –ftrapv option causes unjustified program abort
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 17 Dec 2003 17:01:48 -0000
- Subject: [Bug c/13421] IA32 bigmem pointer subtraction and –ftrapv option causes unjustified program abort
- References: <20031217152930.13421.vik.heyndrickx@pandora.be>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From pinskia at gcc dot gnu dot org 2003-12-17 17:01 -------
Pointers are signed so the subtraction is also signed which causes this problem.
If you want to use the difference without the abort from -ftrapv then do (unsgined)(a)-
(unsigned)(b).
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13421