This is the mail archive of the gcc-help@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: gcc4.1.0: error: object missing in reference to


At 07:19 05.12.2006 -0600, you wrote:
>Hi Fabian,
>
>Is m_cData a static member?

No, normal struct member.

>If not, then I don't think you can do a sizeof(SINOSEventLogBuffer::m_cData)
>on that.

Why is that a problem? I can do sizeof(SINOSEventLogBuffer) without
a problem, why not a member as well? Older gcc's didn't have a problem
with that. I know, newer gcc's have much stricter checking.

Even if this is considered not good programming style, why is it so serious
to be an error and not just a warning?

>Try this instead:
>
>m_uMaxEntrySize = sizeof(((SINOSEventLogBuffer*)NULL)->m_cData);

Yes, that works, thanks a lot.

bye  Fabi



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