Fix compile failure on MacOS X#1373
Closed
zedinosaur wants to merge 2 commits intomobile-shell:masterfrom
Closed
Conversation
std::shared_ptr::unique() is deprecated in C++17 and removed in C++20.
Inspired by PR#1362.
Snippet of the failure:
```
In file included from ../../src/terminal/terminal.h:42:
../../src/terminal/terminalframebuffer.h:431:23: error: 'unique' is deprecated [-Werror,-Wdeprecated-declarations]
431 | if ( !mutable_row.unique() ) {
| ^
/Applications/Xcode_16.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__memory/shared_ptr.h:752:3: note: 'unique' has been explicitly marked deprecated here
752 | _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_HIDE_FROM_ABI bool unique() const _NOEXCEPT { return use_count() == 1; }
| ^
/Applications/Xcode_16.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__config:731:41: note: expanded from macro '_LIBCPP_DEPRECATED_IN_CXX17'
731 | # define _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_DEPRECATED
| ^
/Applications/Xcode_16.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__config:696:49: note: expanded from macro '_LIBCPP_DEPRECATED'
696 | # define _LIBCPP_DEPRECATED __attribute__((__deprecated__))
| ^
1 error generated.
```
Member
|
Isn't this a duplicate of #1362 ? |
Contributor
Author
|
It is sort of a duplicate of #1362. This still isn't compiling due lots of failures that look like this: Which is odd since I would assume this was being compiled with clang on macos. |
Protobuf uses nullability extensions so this warning needs to be disabled.
Contributor
Author
|
More problems: and This looks like these warnings are coming from the -pedantic flag. There's some indication that abseil can't really be compiled with -pedantic (abseil/abseil-cpp#157) since it uses a number of extensions conditionally and intentionally. Maybe it should be removed and more targeted warning flags enabled? |
zedinosaur
added a commit
to zedinosaur/mosh
that referenced
this pull request
Feb 23, 2026
Abseil uses certain compiler extensions intentionally (see abseil/abseil-cpp#157) so it triggers multiple warnings enabled by -pedantic (-Wnullability-extension, -Wgcc-compat, -Wvariadic-macro-arguments-omitted at a minimum) as seen in mobile-shell#1373.
Contributor
Author
|
Closing this in favor of #1374 instead. |
zedinosaur
added a commit
to zedinosaur/mosh
that referenced
this pull request
Feb 23, 2026
Abseil uses certain compiler extensions intentionally (see abseil/abseil-cpp#157) so it triggers multiple warnings enabled by -pedantic (-Wnullability-extension, -Wgcc-compat, -Wvariadic-macro-arguments-omitted at a minimum) as seen in mobile-shell#1373.
achernya
pushed a commit
that referenced
this pull request
Feb 27, 2026
Abseil uses certain compiler extensions intentionally (see abseil/abseil-cpp#157) so it triggers multiple warnings enabled by -pedantic (-Wnullability-extension, -Wgcc-compat, -Wvariadic-macro-arguments-omitted at a minimum) as seen in #1373.
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.
std::shared_ptr::unique() is deprecated in C++17 and removed in C++20.
Inspired by PR#1362.
Snippet of the failure: