Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build errors with './bootstrap-configure --with-device-layer=linux' o… #1442

Merged

Conversation

vivien-apple
Copy link
Contributor

…n macOS with clang

Problem

While doing ./bootstrap-configure --with-device-layer=linux and makethe build fails. Note that while device-layer says Linux there is not really anything specific there.

Also I add to move the template instantiation at the bottom of the file otherwise I was unable to run the platform tests (`make -C src/platform/tests check) because of linking errors.

// Parentheses used to fix clang parsing issue with these declarations
friend CHIP_ERROR(::chip::Platform::PersistedStorage::Read(::chip::Platform::PersistedStorage::Key key, uint32_t & value));
friend CHIP_ERROR(::chip ::Platform::PersistedStorage::Write(::chip::Platform::PersistedStorage::Key key, uint32_t value));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if we use the CHIP_ERROR( syntax, would it work in GCC?

needing an ifdef sounds odd ... is C++ not standard?

there seems to be an extra space in the namespace for Write

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oof. Can we make a macro to address portability issues like this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GCC/Clang will be both happy with parentheses. The issue being some zealous flags that will complains with ConfigurationManager.h:141:22: error: unnecessary parentheses in declaration of 'Read' [-Werror=parentheses]

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I reworked the parentheses so CI is happy, Clang is happy and I hope you will be happy too :)

// Parentheses used to fix clang parsing issue with these declarations
friend CHIP_ERROR(::chip::Platform::PersistedStorage::Read(::chip::Platform::PersistedStorage::Key key, uint32_t & value));
friend CHIP_ERROR(::chip ::Platform::PersistedStorage::Write(::chip::Platform::PersistedStorage::Key key, uint32_t value));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oof. Can we make a macro to address portability issues like this?

@vivien-apple vivien-apple force-pushed the Build_macOSClangDeviceLayerLinux branch 2 times, most recently from 8e416bd to 32b5fd7 Compare July 7, 2020 11:03
@vivien-apple vivien-apple force-pushed the Build_macOSClangDeviceLayerLinux branch from 32b5fd7 to 60964e2 Compare July 7, 2020 11:17
@vivien-apple vivien-apple requested a review from gerickson July 7, 2020 11:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants