This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC 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: non-POD error


Chris Croswhite wrote:
Could someone explain to me why I am seeing this error on the following code:

warning: invalid offsetof from non-POD type `struct
   endpoint_net_struct'; use pointer to member instead

Test case:

#include <stdio.h>
#include <linux/stddef.h>

class Myclass {
  int _val;
};

struct foo_struct {
  void *bar;
  Myclass a;
};

Myclass is a non-POD[9]/4, because it is not an aggregate class [8.5.1]/1
Therefore foo_struct is non-POD too[9]/4.
nathan


--
Nathan Sidwell    ::   http://www.codesourcery.com   ::     CodeSourcery LLC
         The voices in my head said this was stupid too
nathan@codesourcery.com : http://www.cs.bris.ac.uk/~nathan/ : nathan@acm.org



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