-
Notifications
You must be signed in to change notification settings - Fork 480
Description
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 for size_t
). This also can lead to changes in how other format specifiers work on MinGW builds.
So possible solution is to
- Define all needed format specifier macroses manually (including special cases for MinGW) in BOINC headers. Hard to do correctly, but possible (Visual Studio added support of different format specifiers from different versions, MinGW with its own formatters, 32 vs 64 bit types, etc).
or
Allow C++11 in gcc builds (as it's done for Windows builds on vs2019) and
- Define special portable format specifiers based on
<cinttypes>
for MinGW.
or - Define __USE_MINGW_ANSI_STDIO=1 for MinGW builds and use standard format specifiers from
<cinttypes>
.
or - Drop support of MinGW and use VsCode or Community versions of Visual Studio to compile BOINC on Windows. So cross-compiling Windows builds on Linux will not work.
What do you think?
Metadata
Metadata
Assignees
Type
Projects
Status
Status