[cfe-dev] sizeof(struct::member)

Nico Weber thakis at chromium.org
Mon Sep 20 17:58:33 PDT 2010


Hi clang folks,

I have this code:

  sockaddr_un sizecheck;  // not used for anything except sizeof.
  const size_t kMaxPipeNameLength = sizeof(sizecheck.sun_path);

Clang warns about |sizecheck| not being used. Do you consider that a bug?

If so, is there some way to write "sizeof(struct::member)" that
doesn't warn in clang?

Thanks,
Nico



More information about the cfe-dev mailing list