Fix build errors with gcc 16.1.1#317
Closed
larsks wants to merge 1 commit into
Closed
Conversation
Resolve build failures with gcc 16.1.1 by moving the C++ standard library
includes before the pico-sdk includes so that `__unused` is defined before
it is used.
Without these changes, the build fails with:
In file included from /home/lars/src/pico-sdk/src/common/boot_picoboot_headers/include/boot/picoboot.h:15,
from /home/lars/src/picotool/model/model.h:8,
from /home/lars/src/picotool/model/model.cpp:1:
/usr/include/bits/struct_mutex.h:35:9: error: declaration does not declare anything [-fpermissive]
35 | short __unused;
| ^~~~~~~~
In file included from /usr/include/c++/16/x86_64-redhat-linux/bits/gthr-default.h:35,
from /usr/include/c++/16/x86_64-redhat-linux/bits/gthr.h:157,
from /usr/include/c++/16/ext/atomicity.h:37,
from /usr/include/c++/16/bits/shared_ptr_base.h:61,
from /usr/include/c++/16/bits/shared_ptr.h:53,
from /usr/include/c++/16/memory:82,
from /home/lars/src/picotool/model/model.h:43:
/usr/include/c++/16/ext/concurrence.h:124:34: error: cannot convert ‘<brace-enclosed initializer list>’ to ‘__pthread_internal_list*’ in initialization
124 | __gthread_mutex_t _M_mutex = __GTHREAD_MUTEX_INIT;
| ^~~~~~~~~~~~~~~~~~~~
/usr/include/c++/16/ext/concurrence.h:179:44: error: cannot convert ‘<brace-enclosed initializer list>’ to ‘__pthread_internal_list*’ in initialization
179 | __gthread_recursive_mutex_t _M_mutex = __GTHREAD_RECURSIVE_MUTEX_INIT;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
make[2]: *** [model/CMakeFiles/model.dir/build.make:79: model/CMakeFiles/model.dir/model.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:802: model/CMakeFiles/model.dir/all] Error 2
make: *** [Makefile:136: all] Error 2
Signed-off-by: Lars Kellogg-Stedman <lars@oddbit.com>
|
Please do not submit against |
Author
|
My bad. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolve build failures with gcc 16.1.1 by moving the C++ standard library
includes before the pico-sdk includes so that
__unusedis defined beforeit is used.
Without these changes, the build fails with:
Signed-off-by: Lars Kellogg-Stedman lars@oddbit.com