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

GCC minimum version required #84

Closed
raoulh opened this issue Jan 20, 2017 · 4 comments
Closed

GCC minimum version required #84

raoulh opened this issue Jan 20, 2017 · 4 comments

Comments

@raoulh
Copy link
Contributor

raoulh commented Jan 20, 2017

Actually uvw requires a C++14 compiler. Problem is C++14 have a lots of features and not all compiler have all C++14 features working. I tried to build my project using uvw on a Debian Jessie where the current GCC is 4.9.2.

I have a c++14 detection macro in my autotools to detect C++14 availability from the compiler and GCC4.9.2 say it can do C++14.
But I have an error in the build:

uvw/src/uvw/fs.hpp:190:45: error: cannot convert 'std::remove_reference<uv_stat_t&>::type {aka uv_stat_t}' to 'uint64_t {aka long unsigned int}' in initialization
         : path{_path}, stat{std::move(_stat)}

My question here is: Is there a minimum required GCC version that we can check on, or is it worth trying to workaround compilation issue like this one above? or maybe do you know if some checks can be done to detect if compiler can handle this code or not?

@skypjack
Copy link
Owner

skypjack commented Jan 20, 2017

We can use try_compile to test the compiler while running cmake, so that the compilation process is stopped in the early stages. Anyway it sounds like we need to test more or less all the available features from C++14, it isn't that easy to do that.
Moreover, I don't get the error. It has the same type for the data member and for the parameter. Why stat is seen as a long unsigned int? It doesn't make much sense.
Am I missing something?

@raoulh
Copy link
Contributor Author

raoulh commented Jan 20, 2017

I have no idea why stat is long unsigned int... But because it's gcc 4.9.2 it is most likely a compiler bug here.

Of course with a newer GCC (5.3) I don't get any error.

@skypjack
Copy link
Owner

I see. What I mean is that I wouldn't even know what's the feature to be tested to catch this kind of errors.
Anyway, according with C++ standard support in GCC, I'd definitely say that 4.9 doesn't support C++14.
Therefore, saying that one must use a C++14 fully compliant compiler sounds still good.

@raoulh
Copy link
Contributor Author

raoulh commented Jan 20, 2017

Damn, that's true. And the autoconf macro that checks for -std=gnu++14 tells that gcc4.9 can do C++14...
That's bad.

@raoulh raoulh closed this as completed Jan 20, 2017
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