Fix build on macOS 15 / XCode Command Line Tools 16.#45
Merged
Hedede merged 1 commit intoabsurdworlds:masterfrom Oct 10, 2024
BillyONeal:fix-macos-15-xcode-16
Merged
Fix build on macOS 15 / XCode Command Line Tools 16.#45Hedede merged 1 commit intoabsurdworlds:masterfrom BillyONeal:fix-macos-15-xcode-16
Hedede merged 1 commit intoabsurdworlds:masterfrom
BillyONeal:fix-macos-15-xcode-16
Conversation
These build failures were detected while attempting to update vcpkg's test lab, which builds awlib, to macOS 15 "Sequoia" and XCode CLT 16: microsoft/vcpkg#41307 ```console /Users/vcpkg/Data/b/awlib/src/2024-04-06-4d0885f5ee.clean/io/include/aw/io/mmap_file.h:91:7: warning: case value not in enumerated type 'map_perms' [-Wswitch] 91 | case mp::read|mp::exec: | ^ /Users/vcpkg/Data/b/awlib/src/2024-04-06-4d0885f5ee.clean/io/include/aw/io/mmap_file.h:95:7: warning: case value not in enumerated type 'map_perms' [-Wswitch] 95 | case mp::write|mp::exec: | ^ /Users/vcpkg/Data/b/awlib/src/2024-04-06-4d0885f5ee.clean/io/include/aw/io/mmap_file.h:97:7: warning: case value not in enumerated type 'map_perms' [-Wswitch] 97 | case mp::rdwr|mp::exec: | ^ 3 warnings generated. ``` Fixed by casting these values to `unsigned` before going into the switch. I don't think this is particularly 'pretty' but at least it builds. A better solution in vcpkg would be to somehow make these warnings not errors, but I was less confident in being able to suppress that in ways that awlib's maintainers would find acceptable. ``` /Library/Developer/CommandLineTools/usr/bin/c++ -DAW_MODULE_PLATFORM -DAW_STATIC_BUILD -I/Users/vcpkg/Data/b/awlib/src/2024-04-06-b57ded9dee.clean/platform/include -I/Users/vcpkg/Data/b/awlib/src/2024-04-06-b57ded9dee.clean/awlib/include -I/Users/vcpkg/Data/b/awlib/src/2024-04-06-b57ded9dee.clean/types/include -I/Users/vcpkg/Data/b/awlib/src/2024-04-06-b57ded9dee.clean/meta/include -I/Users/vcpkg/Data/b/awlib/src/2024-04-06-b57ded9dee.clean/algorithm/include -I/Users/vcpkg/Data/b/awlib/src/2024-04-06-b57ded9dee.clean/utility/include -I/Users/vcpkg/Data/b/awlib/src/2024-04-06-b57ded9dee.clean/math/include -fPIC -g -std=c++2b -arch x86_64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk -fPIC -fvisibility=hidden -MD -MT platform/CMakeFiles/awplatform.dir/demangle.c++.o -MF platform/CMakeFiles/awplatform.dir/demangle.c++.o.d -o platform/CMakeFiles/awplatform.dir/demangle.c++.o -c /Users/vcpkg/Data/b/awlib/src/2024-04-06-b57ded9dee.clean/platform/demangle.c++ In file included from /Users/vcpkg/Data/b/awlib/src/2024-04-06-b57ded9dee.clean/platform/demangle.c++:10: /Users/vcpkg/Data/b/awlib/src/2024-04-06-b57ded9dee.clean/types/include/aw/types/byte_buffer.h:25:75: error: no member named 'malloc' in namespace 'std'; did you mean simply 'malloc'? 25 | std::unique_ptr<byte_type, free_deleter> memory{ static_cast<byte_type*>(std::malloc(size)) }; | ^~~~~~~~~~~ | malloc /Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/include/malloc/_malloc.h:54:35: note: 'malloc' declared here 54 | void * __sized_by_or_null(__size) malloc(size_t __size) __result_use_check __alloc_size(1) _MALLOC_TYPED(malloc_type_malloc, 1); | ^ In file included from /Users/vcpkg/Data/b/awlib/src/2024-04-06-b57ded9dee.clean/platform/demangle.c++:10: /Users/vcpkg/Data/b/awlib/src/2024-04-06-b57ded9dee.clean/types/include/aw/types/byte_buffer.h:19:45: error: no type named 'free' in namespace 'std' 19 | void operator()(byte_type* memory) { std::free(memory); } | ~~~~~^ 2 errors generated. ``` Fixed by adding missing <cstdlib> for std::malloc and std::free.
Member
|
Thanks for the patch. Saves me a bit of trouble since I don't have access to a mac right now :) |
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.
These build failures were detected while attempting to update vcpkg's test lab, which builds awlib, to macOS 15 "Sequoia" and XCode CLT 16: microsoft/vcpkg#41307
Fixed by casting these values to
unsignedbefore going into the switch. I don't think this is particularly 'pretty' but at least it builds. A better solution in vcpkg would be to somehow make these warnings not errors, but I was less confident in being able to suppress that in ways that awlib's maintainers would find acceptable.Fixed by adding missing
<cstdlib>for std::malloc and std::free.