-
Notifications
You must be signed in to change notification settings - Fork 452
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
On C++11 and up support #3635
Comments
Currently c++11 is not supported. The reason for this is that current Windows release builds are still done on MS VS2010 that is not support c++11. |
It is hard to do in a cross-(platform/compiler) way. Especially if we support old Visual Studio versions, like vs2010. Portable format specifiers were added in
|
Is there a bug here, or is it just about compiler warnings? |
In general, if the syntax of a conversion specification is invalid, behavior is undefined, and can cause program termination. For example, at https://github.com/BOINC/boinc/pull/3633/files#diff-af2978c2e9a6dcbd81e11d25b397ecadR1434 and https://github.com/BOINC/boinc/pull/3633/files#diff-af2978c2e9a6dcbd81e11d25b397ecadR1444 we output incorrect addresses of exception sources on x86-64 when they > at https://github.com/BOINC/boinc/pull/3633/files#diff-2100491c40a00d1c0a6c54ed6a816619R732 we dump incorrect cpu registers / stack frame values on x86-64 when they > |
I recall that I used |
Problem is gcc rejects to build with |
Decided to define portable |
Wondering what the reason is to still support Visual Studio 2010. |
Ain't there a way to upgrade to a newer Visual Studio? Secondly, I noticed that clearly on Ubuntu C++11 features compile fine for BOINC. So if no C++11 features are allowed, than the compiler options should specify the standard to enforce compliance. |
It's already done. But while there is no new release for Windows with VS2019 - we don't drop VS2010 support.
Because next release we want to make with VS2019, so no need to add this restriction now. So this ticket will leave for a while and soon will be closed without any fix. |
I'm implementing ticket 4180. You're saying that I can now use C++11 statements? What will be the new standard after the next release? C++11, C++14 or C++17? |
After BOINC will be released for Windows and I close this ticket - Regarding next standard - I don't know yet. |
Is it correct that after #4207 be merged I can use |
@dimhotepus, I'd ask you to wait until next Windows release. Then coding style document should be updated with new requirements. #4207 was merged because it touched only linux code. For Windows we still want to have a fallback solution in case smth goes wrong. I'll inform you when there will be a green light for your PR ;) |
Any progress on the C++11 adoption? I noticed my pull request still fails on Android and OSX manager builds because of lack of C++11 support (auto keyword and lambda). |
@cnergyone, no updates right now. I'll notify you about it |
@cnergyone My understanding is that current versions of Xcode on MacOS enable C++11 support by default. But I'm not certain of that. You can test this by modifying mac_build/buildMacBOINC-CI.sh to pass the argument Let me know if making those changes fixes the errors; that would indicate that apparently C++11 support is not enabled by default. If so, I'll update the Xcode project and buildMacBOINC.sh script accordingly. |
@cnergyone Which pull request is failing on MacOS Manager due to those keywords? The only PR I'm finding from you is #4181 and the error is not due to either of those keywords. |
@cnergyone Actually, GitHub is a bit confusing when I search for Pull Requests authored by you, it says #4181 but it seems to be #4207. Either way, the error for MacOS Manager is not due to either the auto keyword or lambda. |
@cnergyone Sorry, as I've dug into this a bit more I realize I'm not familiar with more advanced concepts in C++11 such as lambda expressions. But I have confirmed that by specifying C++11 support, your code does compile on MacOS without generating any errors. However, specifying C++11 support on MacOS does generate warnings and errors in other source files. I will try to submit a PR in the next week or two to enable C++11 support on macOS. |
@cnergyone @AenBleidd I have completed the changes for C++11 support on MacOS in my PR #4304. |
Please be aware that we're not ready now to accept any c++11 specific features. When next release for Windows will be released with no issues using VS2019, then c++11 support will be officially announced. |
Currently BOINC has limited support of c++11 and later standards. But even if I say that BOIN Chas limited support of c++11 and later, that doesn't mean that we will rewrite any part of the existing code to the newer c++ standard. The current codebase is stable enough, so there is no reason to put any efforts to rewrite any part of it with the newer c++ standard. |
Does BOINC support C++11?
For example, i want to fix undefined behavior (which may lead to security issues) when
printf
-like functions get incompatible format specifier and actual parameter type: #3633 In order to do that, i either need to include<cinttypes>
(C++11 thing) for portable format specifiers, or add ugly macroses to duplicate such functionality in BOINC headers.If we support MinGW builds, things become even more complicated. MinGW uses old msvcrt runtime, and requires special define __USE_MINGW_ANSI_STDIO=1 to mimic C11 behavior (
%zu
format specifier forsize_t
). This also can lead to changes in how other format specifiers work on MinGW builds.So possible solution is to
or
Allow C++11 in gcc builds (as it's done for Windows builds on vs2019) and
<cinttypes>
for MinGW.or
<cinttypes>
.or
What do you think?
The text was updated successfully, but these errors were encountered: