Re: EXC_BAD_ACCESS error
Re: EXC_BAD_ACCESS error
- Subject: Re: EXC_BAD_ACCESS error
- From: Jean-Daniel Dupas <email@hidden>
- Date: Wed, 13 Oct 2010 14:36:05 +0200
Le 13 oct. 2010 à 13:24, Andreas Grosam a écrit :
>
> On Oct 11, 2010, at 3:57 PM, Jean-Daniel Dupas wrote:
>
>> Accessing an array using a negative index is undefined in C++, so may crash, or may not depending the compiler, the OS, the phase of the moon, etc…
> The behavior is not undefined. Using negative indices is perfectly valid code (see below).
>
I don't know for C++, but it is undefined in C99 AFAIK (See section 6.5.6.8 of the C99 standard)
And in the list of undefined behavior:
- Addition or subtraction of a pointer into an array object and an integer type produces a result that does not point into the same array object (6.5.6).
-- Jean-Daniel
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden