[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: luajit FFI cdata problem
- From: Mike Pall <mikelu-1103@...>
- Date: Wed, 30 Mar 2011 19:28:19 +0200
> On 31 March 2011 03:53, Mike Pall <firstname.lastname@example.org> wrote:
> > Look at the error message. You can compare two pointers, but not
> > two aggregates.
> But surely you can see that the aggregates are the same type, and
> located at the same place in memory: how could they ever not be equal?
That doesn't make it a well-defined or even a useful operation.
You cannot compare two aggregates in C, either.
If you want to compare by reference, then compare their pointers.
If you want to compare by value, then compare their elements.
[This is undefined in C, precisely because everyone has a
different idea on what struct == struct might do. All bets are off
for struct <= struct, anyway.]