[ovs-dev] [PATCH 3/3] Avoid uninitialized variable warnings with OBJECT_OFFSETOF() in MSVC.

Ben Pfaff blp at nicira.com
Fri Sep 12 15:11:30 UTC 2014


On Fri, Sep 12, 2014 at 02:11:00PM +0000, Eitan Eliahu wrote:
> [2] The usage of the decltype  does work with of a built in VS project I created:
> #define OBJECT_OFFSETOF(OBJECT, MEMBER) \
>       ((LONG)(LONG_PTR)&((decltype(OBJECT))0)->MEMBER)
> I think it is the right way to implement it. But, this keyword "decltype" is ignored by the compiler when above  macro is used in the OVS source base. I don't know the reason for it but it might be related to custom compilation options we use (or others we don't use).

decltype is a C++ keyword I believe.



More information about the dev mailing list