Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Exactly, thank you.

I've always called "tag" the id that optionally follows struct/union/enum. Is it the wrong word? Some specs call it "name", but "unnamed union" sounds dangerously similar to "anonymous union", which is a different concept, namely (no pun!) an unnamed member of an outer struct or union whose submembers can be accessed as if they belong in the outer one. E.g.

  struct {
    struct {
      int m;
    }; // no name: anonymous
  struct s;
  s.m = 1;


Yep, tag is the correct terminology. See, e.g., section 6.7.3.4 Tags in N3220 (https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3220.pdf)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: