Skip to content
Snippets Groups Projects

Use named struct

Merged Christoph Grüninger requested to merge cherry-pick/named-struct into releases/2.7
1 unresolved thread

This fixes Clang 11's warning: anonymous non-C-compatible type given name for linkage purposes by typedef declaration; add a tag name here [-Wnon-c-typedef-for-linkage]

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Cherry-picks !169 (merged), which is still blocked by the CI.

  • Oliver Sander mentioned in commit 5840fb2c

    mentioned in commit 5840fb2c

  • merged

    • While we wait, here is a question out of curiosity: The same typedef {} NAME; construction is used all over UG. Why is it necessary to change only this particular one?

    • The compiler complains because an element within the struct is initialized. I want it to be fixed, because it pollutes the output of the DuMuX builds.

      Here is what Clang told me:

      /home/gruenich/dune-uggrid/dune/uggrid/gm/gm.h:2520:15: warning: anonymous non-C-compatible type given name for linkage purposes by typedef declaration; add a tag name here [-Wnon-c-typedef-for-linkage]
      typedef struct {
                    ^
                     GENERAL_ELEMENT
      /home/gruenich/dune-uggrid/dune/uggrid/gm/gm.h:2547:27: note: type is not C-compatible due to this default member initializer
        INT mapped_inner_objt = -1;                               /* tag to objt mapping for free list*/
                                ^~
      /home/gruenich/dune-uggrid/dune/uggrid/gm/gm.h:2562:3: note: type is given name 'GENERAL_ELEMENT' for linkage purposes by this typedef declaration
      } GENERAL_ELEMENT;
        ^
      1 warning generated.
    • Please register or sign in to reply
Please register or sign in to reply
Loading