-
Notifications
You must be signed in to change notification settings - Fork 82
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
Util/ClusterReader.cpp implicit type conversion an issue with compilers with C++11 as default language standard #108
Comments
The program is written using the pre-C++11, so really C++03, language standard, and this particular issue states that it doesn't compile with C++14. Can you explain why would you expect it should? These are occasionally backward incompatible standards (see FTR below). To emphasize this point, would you consider it a valid issue to say it doesn't compile as C#? What would be the benefit of actually porting it to a newer standard (C++11 or C++14), as opposed to simply instructing the compiler to use the older standard, which it normally knows about? There might well be a valid issue here, which is that the configuration flags do not explicitly ask for FTR: The backward incompatibility here is that pre-C++11, |
I agree, and have changed the title of the issue accordingly. What I meant is that when users compile SGA, the compilers will very likely issue errors on this in the future. It would be nice to have what you suggested: to change the configuration flag to explicitly ask for C++03, now that C++ is (and compilers are as well) evolving rapidly. But IMO, the fix I suggested (or any explicit type conversion) is not that a big change, at least not asking for a C# port. |
I agree that particular change is small, I think it's in only 2 places. But there's always the chance something else will pop up, for instance some other type conversion which doesn't work exactly as before. As long as it's easier to instruct the compiler to use the older standard, I see little motivation to do anything else. So, which compiler versions did you encounter this issue on? Here we're using Alternatively, can you try |
Hi @mateidavid, admittedly, I didn't compile the SGA program but rather some other program that incorporates SGA, and specifically asks for C++11 as the language standard. But since SGA provides an opportunity for being imported, the use case is valid for SGA to consider. And the user community would appreciate it. I've confirmed (while, not confirmed, but found an indication strong enough) by running the following test program, that the language standard is the cause:
Compiling with several options, both clang and gcc, when asked specifically for C++11/14, issues the error. Thank you. clang_APPLE.7.0.2_verbose.txt |
We should leave this open for Jared to have a look. I agree that integration of SGA into other projects (or import of some other project into SGA, if necessary) is a more compelling reason to make it C++11 friendly than the fact that compilers occasionally change their default dialect. Is the enclosing project using SGA build products (executables) or SGA source files? If it is using SGA build products, the enclosing project should simply take care not to pass flags such as |
Sorry, pressed the wrong button and accidentally closed. Now reopened. The tool (not finished product yet I believe) imports SGA as source, so yes, this is a valid reason for the team to make SGA more future-proof, as I believe there will be more developers doing this since SGA is a highly-regarded tool. |
I just upgraded to the new GCC 6.1, which uses -std=c++14 as default. I recompiled SGA (actually, I recompiled the SnowTools, which are based on SGA) and I got a couple of minor issues. Give a look to this simple patch:
The second change should only avoid possible problems and it should not give any issues on other compiler. On the contrary, I am not sure about the first change. Maybe it would be a good idea to use macros to switch between the |
Hi, there seem to be an issue on line 70 when compiled with C++14 (either clang or gcc),
which reports
turning off the C++14 support seem to solve the problem. Or a simpler solution would be to replace the line with minimal change:
The text was updated successfully, but these errors were encountered: