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

Add -Wno-error=attributes if the current compiler is GCC #375

Open
pavel-kirienko opened this issue Aug 11, 2024 · 2 comments
Open

Add -Wno-error=attributes if the current compiler is GCC #375

pavel-kirienko opened this issue Aug 11, 2024 · 2 comments
Assignees
Labels
class-feature domain-build Issues that are about building libcyphal. priority-low A minor issue

Comments

@pavel-kirienko
Copy link
Member

Because older versions of GCC do not recognize [[unused]] and hence break the build.

@pavel-kirienko pavel-kirienko added class-feature priority-low A minor issue domain-build Issues that are about building libcyphal. labels Aug 11, 2024
@serges147
Copy link
Collaborator

@pavel-kirienko Please give me details how to reproduce it. F.e. what exact "older" version of GCC I should try on? Thanks!
BTW, do we have somewhere documented which toolsets and their minimal versions we support?

@pavel-kirienko
Copy link
Member Author

I was trying to build it on my laptop last night which has GCC 11, which produced this warning. This is a known issue; in another codebase we have this:

# Disable GCC warnings that produce false positives due to bugs in the compiler.
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unknown-attributes -Wno-maybe-uninitialized -Wno-uninitialized")
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-error=stringop-overread")
endif ()

Clang appears to be much more stable btw.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
class-feature domain-build Issues that are about building libcyphal. priority-low A minor issue
Projects
None yet
Development

No branches or pull requests

2 participants