2013/4/9 Jordan Rose <[email protected]>:
>
> On Apr 9, 2013, at 6:46 , Serge Pavlov <[email protected]> wrote:
>
>> Hi Richard,
>>
>> I've changed the check as you recommended before.
>>
>> 2013/4/9 Richard Smith <[email protected]>:
[...]
>>> the only other case for GNU C, but Objective-C might add some more
>>> possibilities?
>>
>> Yes, array of empty records is another king of zero-size object, which I 
>> missed.
>> As for Objective-C, I couldn't invent something new...
>
> I think it's safe to ignore Objective-C. In theory you can declare a 
> zero-size object (which will then be recognized by the runtime somehow, like 
> tagged pointers), but in practice it won't happen in user code. You can't 
> take the size of an Objective-C object in the non-fragile runtime, and even 
> in the fragile runtime you can't create an Objective-C object on the stack.
>
> Jordan

Thank you for the explanation. If object size is unavailable, then the
pointer subtraction doesn't make sense. Indeed, an expression like
'x-y' causes "error: arithmetic on pointer to interface 'empty', which
is not a constant size for this architecture and platform".

--Serge

_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to