This is the mail archive of the ecos-patches@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Fix compilation error in i2c.cxx


Bart Veer wrote:
>
> That is true in C but not necessarily in C++. I don't remember all the
> details offhand, but NULL involves casting to void* which is not
> always acceptable. I wanted to use a prioritized static constructor in
> the I2C code, so it was easier to write the lot in C++.

Nothing like a trivial thing to make everyone stick their oar in...

I think you want a plain un-cast 0 in C++.  Since an integer 0 can be
implicitly cast to any pointer type.

Also, in GCC NULL is #define'd as __null which is something funky.  The
details of which I can't recall.

David Vrabel
-- 
David Vrabel, Design Engineer

Arcom, Clifton Road           Tel: +44 (0)1223 411200 ext. 3233
Cambridge CB1 7EA, UK         Web: http://www.arcom.com/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]