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

Breaking change in gcc-11 and clang-12 #1421

Open
ramblehead opened this issue Jul 9, 2021 · 1 comment
Open

Breaking change in gcc-11 and clang-12 #1421

ramblehead opened this issue Jul 9, 2021 · 1 comment

Comments

@ramblehead
Copy link
Contributor

See https://stackoverflow.com/a/68149587

make error output example after successful cmake:

... [cut] ...
[ 27%] Building CXX object src/CMakeFiles/rct.dir/rct/rct/FileSystemWatcher.cpp.o
In file included from /home/rh/box/shed/rhpm/packages/emacs-rtags/src/src/rct/rct/Buffer.cpp:1:
In file included from /home/rh/box/shed/rhpm/packages/emacs-rtags/src/src/rct/rct/Buffer.h:7:
In file included from /home/rh/box/shed/rhpm/packages/emacs-rtags/src/src/rct/rct/String.h:9:
/home/rh/box/shed/rhpm/packages/emacs-rtags/src/src/rct/rct/List.h:17:41: error: no member named 'numeric_limits' in namespace 'std'
    static constexpr size_t npos = std::numeric_limits<size_t>::max();
                                   ~~~~~^
/home/rh/box/shed/rhpm/packages/emacs-rtags/src/src/rct/rct/List.h:17:56: error: unexpected type name 'size_t': expected expression
    static constexpr size_t npos = std::numeric_limits<size_t>::max();
                                                       ^
/home/rh/box/shed/rhpm/packages/emacs-rtags/src/src/rct/rct/List.h:17:65: error: no member named 'max' in the global namespace
    static constexpr size_t npos = std::numeric_limits<size_t>::max();
                                                              ~~^
3 errors generated.
make[2]: *** [src/CMakeFiles/rct.dir/build.make:89: src/CMakeFiles/rct.dir/rct/rct/Buffer.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
... [cut] ...

Temporary fix:

readonly GCC_VERSION=11
export readonly CXX=g++-${GCC_VERSION}
export readonly CXXFLAGS="-include /usr/include/c++/${GCC_VERSION}/limits"

In long term should be fixed in source.

@seelabs
Copy link

seelabs commented Aug 5, 2021

I just ran into this as well. I patched List.h to add #include <limits> to work around this.

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