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

McOS Compiler Warnings, changes will be needed for LLVM-19 #369

Open
anjohnson opened this issue Jan 17, 2025 · 1 comment
Open

McOS Compiler Warnings, changes will be needed for LLVM-19 #369

anjohnson opened this issue Jan 17, 2025 · 1 comment

Comments

@anjohnson
Copy link
Contributor

Hi Evan, I just built the 2025.1 on MacOS and saw some warnings from Apple's Clang-16 that you should at least be aware of. Not an issue right now though, thanks for the update!

These were MacOS build warnings when compiling Nedit-ng tag 2025.1-3-g61a960ea with a CXX Compiler "AppleClang 16.0.0.16000026". The resulting binary runs fine, but the warnings imply that some code changes will probably be needed for future Clang versions.

I'm only including one copy of each warning, most were emitted for multiple source files, some were for templates that are instantiated in more than one place.

In file included from /Users/anj/Software/other/nedit-ng/src/Highlight.h:5:
/Users/anj/Software/other/nedit-ng/src/TextBufferFwd.h:8:44: warning: 'char_traits<unsigned char>' is deprecated: char_traits<T> for T not equal to char, wchar_t, char8_t, char16_t or char32_t is non-standard and is provided for a temporary period. It will be removed in LLVM 19, so please migrate off of it. [-Wdeprecated-declarations]
    8 | template <class Ch = char, class Tr = std::char_traits<Ch>>
      |                                            ^
/Users/anj/Software/other/nedit-ng/src/TextBufferFwd.h:12:21: note: in instantiation of default argument for 'BasicTextBuffer<uint8_t>' required here
   12 | using UTextBuffer = BasicTextBuffer<uint8_t>;
      |                     ^~~~~~~~~~~~~~~~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.1.sdk/usr/include/c++/v1/__string/char_traits.h:81:8: note: 'char_traits<unsigned char>' has been explicitly marked deprecated here
   81 | struct _LIBCPP_DEPRECATED_(
      |        ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.1.sdk/usr/include/c++/v1/__config:996:53: note: expanded from macro '_LIBCPP_DEPRECATED_'
  996 | #      define _LIBCPP_DEPRECATED_(m) __attribute__((__deprecated__(m)))
      |                                                     ^

In file included from /Users/anj/Software/other/nedit-ng/src/DialogSmartIndent.cpp:14:
/Users/anj/Software/other/nedit-ng/Util/include/Util/algorithm.h:57:37: warning: unused parameter 'array' [-Wunused-parameter]
   57 | constexpr ptrdiff_t ssize(const T (&array)[N]) noexcept {
      |                                     ^

In file included from /Users/anj/Software/other/nedit-ng/src/DocumentWidget.h:5:
In file included from /Users/anj/Software/other/nedit-ng/src/Bookmark.h:5:
In file included from /Users/anj/Software/other/nedit-ng/src/TextBuffer.h:8:
In file included from /Users/anj/Software/other/nedit-ng/src/gap_buffer.h:6:
/Users/anj/Software/other/nedit-ng/src/gap_buffer_fwd.h:7:44: warning: 'char_traits<unsigned char>' is deprecated: char_traits<T> for T not equal to char, wchar_t, char8_t, char16_t or char32_t is non-standard and is provided for a temporary period. It will be removed in LLVM 19, so please migrate off of it. [-Wdeprecated-declarations]
    7 | template <class Ch = char, class Tr = std::char_traits<Ch>>
      |                                            ^
/Users/anj/Software/other/nedit-ng/src/TextBuffer.h:229:2: note: in instantiation of default argument for 'gap_buffer<unsigned char>' required here
  229 |         gap_buffer<Ch> buffer_;
      |         ^~~~~~~~~~~~~~
/Users/anj/Software/other/nedit-ng/src/DocumentWidget.cpp:5689:44: note: in instantiation of template class 'BasicTextBuffer<unsigned char>' requested here
 5689 |         uint8_t style = highlightData->styleBuffer->BufGetCharacter(pos);
      |                                                   ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.1.sdk/usr/include/c++/v1/__string/char_traits.h:81:8: note: 'char_traits<unsigned char>' has been explicitly marked deprecated here
   81 | struct _LIBCPP_DEPRECATED_(
      |        ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.1.sdk/usr/include/c++/v1/__config:996:53: note: expanded from macro '_LIBCPP_DEPRECATED_'
  996 | #      define _LIBCPP_DEPRECATED_(m) __attribute__((__deprecated__(m)))
      |                                                     ^

While I'm reporting, these warnings are emitted by the MacOS linker:

[ 39%] Linking CXX executable ../nc-ng
ld: warning: ignoring duplicate libraries: '../Regex/libRegex.a', '../Util/libUtil.a'
[ 41%] Linking CXX executable ../nedit-import
ld: warning: ignoring duplicate libraries: '../Regex/libRegex.a', '../Util/libUtil.a'
[ 55%] Linking CXX executable ../nedit-ng
ld: warning: ignoring duplicate libraries: '../Regex/libRegex.a', '../Util/libUtil.a'
@eteran
Copy link
Owner

eteran commented Jan 17, 2025

Partial fix just merged in: #370

The warning about std:char_traits<unsigned char> is interesting, because I didn't realize that it was an extension. I'll have to see about refactoring that out which is a slightly more complicated fix.

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

No branches or pull requests

2 participants