Uploaded image for project: 'WiredTiger'
  1. WiredTiger
  2. WT-6601

Clang Format doesn't handle TAILQ macros well

    • Type: Icon: Task Task
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None

      We had a few examples of where Clang Format has put unwanted line breaks in the middle of a struct member definition or moved the pointer alignment in an inconsistent position.

          TAILQ_HEAD(__wt_keyedhash, __wt_keyed_encryptor)
          keyedhashqh[WT_HASH_ARRAY_SIZE];
      
       TAILQ_HEAD(__wt_keyedhash, __wt_keyed_encryptor) * keyedhashqh;
      
          /* Hashed handle reference list array */
          TAILQ_HEAD(__dhandles_hash, __wt_data_handle_cache) * dhhash;
      

      We should investigate some options on how we can do better here.

      This is always going to be a challenge because macros aren't part of normal C syntax so unless the formatter works as a preprocessor (it doesn't), then it just looks like a function call has been placed where a type should be.

            Assignee:
            backlog-server-storage-engines [DO NOT USE] Backlog - Storage Engines Team
            Reporter:
            alex.cameron@mongodb.com Alex Cameron (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: