Skip to content

Conversation

Empact
Copy link
Contributor

@Empact Empact commented Mar 7, 2019

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.

Empact and others added 4 commits March 4, 2019 21:36
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.
-Werror=documentation if isystem & werror are enabled.
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.
@DrahtBot
Copy link
Contributor

DrahtBot commented Mar 7, 2019

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.

@Empact
Copy link
Contributor Author

Empact commented Mar 8, 2019

Needs some work

@Empact Empact closed this Mar 8, 2019
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Dec 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants