• mina86deleted by creator
    link
    fedilink
    English
    arrow-up
    47
    ·
    edit-2
    3 months ago

    deleted by creator

      • Obin@feddit.org
        link
        fedilink
        arrow-up
        19
        ·
        8 months ago

        You mean ‘unnamed’ is what’s confusing you?

        Normally you can do anonymous struct/union members or struct struct/union members that are tagged structs but not anonymous.

        I.e. in standard C you’d have to do either:

        struct foo { int baz; };
        struct bar { struct foo foo; };
        ...
        struct bar data;
        data.foo.baz = 0;
        

        or:

        struct bar { struct {  int baz; } foo; };
        ...
        struct bar data;
        data.baz = 0;
        

        but to do the following, you’d need the extension:

        struct foo { int baz; };
        struct bar { struct foo; };
        ...
        struct bar data;
        data.baz = 0;
        
        • mina86deleted by creator
          link
          fedilink
          English
          arrow-up
          8
          ·
          edit-2
          3 months ago

          deleted by creator

          • MinekPo1 [it/she]@lemmygrad.ml
            link
            fedilink
            arrow-up
            3
            ·
            8 months ago

            “ANSI C” by Kernighan and Ritchie disagrees , including that syntax (note : retranslation from Polish as that’s the language my copy is in) :

            A8.3

            […]

            struct-union-specifier:
            , union-struct identifier ₒₚₜ { compound-declaration-list }
            , union-struct identifier

            […]

            Specifiers of structures or unions with [a compound declaration] list, but with no label [identifier], creates a unique type; it may only be referred to in the declaration in which it is part.

            • mina86deleted by creator
              link
              fedilink
              English
              arrow-up
              1
              ·
              edit-2
              3 months ago

              deleted by creator

            • mina86deleted by creator
              link
              fedilink
              arrow-up
              1
              ·
              edit-2
              3 months ago

              deleted by creator

      • mina86deleted by creator
        link
        fedilink
        English
        arrow-up
        13
        ·
        edit-2
        3 months ago

        deleted by creator