build: Optionally enable -Wthread-safety-attributes #15556

pull Empact wants to merge 4 commits into bitcoin:master from Empact:wthread-safety-attributes changing 12 files +85 −26
  1. Empact commented at 5:11 pm on March 7, 2019: member

    And solve error: 'assert_exclusive_lock' attribute requires arguments whose type is annotated with 'capability' attribute; type here is 'void *' by introducing an abstract base Lock class.

    Builds on #14920.

  2. build: Optionally include dependency headers with -isystem
    When configured with --enable-isystem.
    
    Was necessary to split QT_INCLUDES into QT_INCLUDES and
    QT_MOC_INCLUDES because moc does not understand -isystem, e.g.:
    
        Unknown options: isystem/usr/local/Cellar/qt/5.10.0_1/include/QtNetwork[...]
    
    This does not convert all uses, but focuses on libraries which have triggered
    warnings/errors when applying initial additional build checks: QT, Univalue, and Berkeley DB.
    LevelDb requires additional measures as its code is compiled with the project warnings
    via AM_CXXFLAGS.
    
    Note -isystem should not be applied to /usr/include, see BITCOIN_SYSTEM_INCLUDE
    for a helper to convert -I to -isystem with /usr/include excepted.
    685ea2facf
  3. Fix -Wdocumentation errors 4334b4c464
  4. build: Enable -Wdocumentation if isystem is enabled
    -Werror=documentation if isystem & werror are enabled.
    b51f4e1413
  5. build: Optionally enable -Wthread-safety-attributes
    And solve associated error:
        In file included from sync.cpp:5:
        ./sync.h:66:106: error: 'assert_exclusive_lock' attribute requires arguments whose type is annotated with 'capability' attribute; type here is 'void *' [-Werror,-Wthread-safety-attributes]
        void static inline AssertLockHeldInternal(const char* pszName, const char* pszFile, int nLine, void* cs) ASSERT_EXCLUSIVE_LOCK(cs) {}
                                                                                                               ^
        ./threadsafety.h:34:49: note: expanded from macro 'ASSERT_EXCLUSIVE_LOCK'
        #define ASSERT_EXCLUSIVE_LOCK(...) __attribute((assert_exclusive_lock(__VA_ARGS__)))
                                                      ^
        In file included from threadinterrupt.cpp:6:
        In file included from ./threadinterrupt.h:8:
        ./sync.h:66:106: error: 'assert_exclusive_lock' attribute requires arguments whose type is annotated with 'capability' attribute; type here is 'void *' [-Werror,-Wthread-safety-attributes]
        void static inline AssertLockHeldInternal(const char* pszName, const char* pszFile, int nLine, void* cs) ASSERT_EXCLUSIVE_LOCK(cs) {}
                                                                                                               ^
        ./threadsafety.h:34:49: note: expanded from macro 'ASSERT_EXCLUSIVE_LOCK'
        #define ASSERT_EXCLUSIVE_LOCK(...) __attribute((assert_exclusive_lock(__VA_ARGS__)))
                                                      ^
        1 error generated.
    db2f41b6d0
  6. laanwj added the label Build system on Mar 7, 2019
  7. DrahtBot commented at 8:05 pm on March 7, 2019: member

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #15112 (build: Optionally enable -Wzero-as-null-pointer-constant by Empact)
    • #14137 (gui: Add Windows taskbar progress by ken2812221)
    • #13728 (WIP: Scripts and tools: Run the CI lint stage on mac by Empact)

    If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

  8. Empact commented at 0:53 am on March 8, 2019: member
    Needs some work
  9. Empact closed this on Mar 8, 2019

  10. DrahtBot locked this on Dec 16, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-12-19 00:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me