Embarcadero C++ and Boost libraries
Embarcardero ( formerly Codegear, formerly Borland ) has had for about five years C++ compilers based on clang, along with the venerable bcc32, which is the Borland compiler of old through a number of transformations. The clang-based Windows compilers are bcc32c/bcc32x for 32-bit development and bcc64 for 64-bit development. The only difference between bcc32c and bcc32x is that the former takes the same command line flags as their legacy bcc32 compiler while the latter, like bcc64, takes clang command line flags. The clang-based C++ compilers are based on clang-5.0, and use the Dinkumware library. The clang based compilers still predefine __BORLANDC__ and __CODEGEARC__ but also predefine __clang__. The latter is the way to distinguish in preprocessor code between the bcc32 compiler and the clang-based compilers. Despite numerous workarounds in Boost code based on the predefined macros __BORLANDC__ and __CODEGEARC__ the bcc32 compiler, not being very C++ compliant even at the C++98/C++03 level at which it operates, has not really worked for Boost since about Boost 1.39. It is useless for modern day Boost. Therefore I have made efforts, in contact with some Embarcadero C++ representatives, to integrate the clang-based compilers into Boost, especially since there is a free non-commercial offering by Embarcadero called C++ Builder Community Edition at https://www.embarcadero.com/products/cbuilder/starter which any Boost developer could use to test these compilers if they wished. I am doing this in the hopes that this may become effective for Boost 1.74.0. Doing this involves: 1) Creating an embarcadero.jam toolset, based on the clang-linux.jam toolset, which supports bcc32x and bcc64. Updating the borland.jam toolset to also support bcc32c. I have done these and the PR has been merged to 'develop' on Boost Build. 2) Updating Boost Config to support the clang-based compilers. I have done this and the PR has been merged to 'develop' on Boost Config. 3) In the update to Boost Config, I have created these macros: a) BOOST_BORLANDC = __BORLANDC__ with __clang__ not defined b) BOOST_CODEGEARC = __CODEGEARC__ with __clang__ not defined c) BOOST_EMBTC = Embarcadero C++ compilers with __clang__ defined Therefore what is really needed in Boost libraries is to change all the code which currently uses __BORLANDC__ to BOOST_BORLANDC and all the code which uses __CODEGEARC__ to BOOST_CODEGEARC when Boost config has been included. When in the rarer case that Boost config has not been included, then __BORLANDC__ logic becomes __BORLANDC__ and !__clang__ and __CODEGEARC__ logic becomes __CODEGEARC__ and !__clang__. I am workiog on doing this for the numerous Boost libraries with workarounds nased on __BORLANDC__ and __CODEGEARC__ in Boost code, and will create PRs for those libraries. I only ask that library maintainers will merge the PRs I create once they have passed their CI tests, since the PRs are almost all just simple transformations regarding the __BORLANDC__ and __CODEGEARC__ in the code. If any library maintainer wants to so this on their own in the 'develop' branch it would be appreciated. Further points: The Embarcadero C++ clang-based compilers are not as good as clang itself, which is at release 9, gcc, or vc++. But they are good enough for the majority of Boost code. The Embarcadero C++ clang-based compilers support only C++17. The documentation implies that they also support C++11 and C++14 but that is not so. But since Boost libraries written for a C++ standard level are supposed to work flawlessly at a higher level this is no impediment for C++ Builder programmers using the Embarcadero C++ compilers in current Boost. I have reported a number of bugs, based on my Boost testing, for the Embarcadero C++ compilers to Embarcadero themselves in their bug reporting system. I believe that any registered user of their free community edition can report bugs to Embarcadero C++ at their bug reporting system at https://quality.embarcadero.com. Hopefully these reports will improve the compilers. It would really be nice, once the Embarcadero C++ clang-based compilers are integrated into current Boost, if regression testers could test their compilers. I will try to do so myself if I have the time and resources. I have discussed this with some Embarcadero C++ representatives about adding the Embarcadero clang-based C++ compilers to one or more CI testing services, but currently there are not any which support them of which I know. Besides the clang-based Windows compiler Embarcadero also has clang-based C++ compilers for 32-bit and 64-bit iOS ( Apple ) and for Android ( Google ). The code in Boost Config distinguishes between these environments, if necessary, with further macros based off of the mnemonic BOOST_EMBTC. It would be nice to add these configurations to embarcadero.jam once the rest of the work is done. But I have no idea how to test any of these other compilers as they are not part of the Windows based Embarcardero C++ Builder Community Edition.
On 2020-03-30 19:45, Edward Diener via Boost wrote:
2) Updating Boost Config to support the clang-based compilers. I have done this and the PR has been merged to 'develop' on Boost Config.
3) In the update to Boost Config, I have created these macros:
a) BOOST_BORLANDC = __BORLANDC__ with __clang__ not defined b) BOOST_CODEGEARC = __CODEGEARC__ with __clang__ not defined c) BOOST_EMBTC = Embarcadero C++ compilers with __clang__ defined
Are these macros not documented in Boost.Config?
On 5/1/2020 10:37 AM, Andrey Semashev via Boost wrote:
On 2020-03-30 19:45, Edward Diener via Boost wrote:
2) Updating Boost Config to support the clang-based compilers. I have done this and the PR has been merged to 'develop' on Boost Config.
3) In the update to Boost Config, I have created these macros:
a) BOOST_BORLANDC = __BORLANDC__ with __clang__ not defined b) BOOST_CODEGEARC = __CODEGEARC__ with __clang__ not defined c) BOOST_EMBTC = Embarcadero C++ compilers with __clang__ defined
Are these macros not documented in Boost.Config?
They are not documented in the Boost.Config documentation. But neither are any other BOOST_ compiler specific macros. BOOST_BORLANDC = __BORLANDC__ && !__clang__ BOOST_CODEGEARC = __CODEGARC__ && !__clang__ BOOST_EMBTC = __CODEGEARC__ && __clang__ I did not want to have to type the equivalent of the long form whenever Boost config.hpp was included in some library's code, so I created the macros in borland.hpp and embarcadero.hpp in Boost.Config. In cases in a library's code where Boost config.hpp is not being included in some TU (rare) I create the equivalent of the long form as my fix. The idea of my PRs to incorporate Embracadero's clang-based compilers into Boost was to change all the old references to __BORLANDC__ and __CODEGEARC__ to BOOST_BORLANDC and BOOST_CODEGEARC respectively so that the Embarcadero clang based compilers are not affected by them. There are still bugs in the Embarcadero clang based compilers, but much, much less than in the old bcc32.
On 2020-05-01 18:50, Edward Diener via Boost wrote:
On 5/1/2020 10:37 AM, Andrey Semashev via Boost wrote:
On 2020-03-30 19:45, Edward Diener via Boost wrote:
2) Updating Boost Config to support the clang-based compilers. I have done this and the PR has been merged to 'develop' on Boost Config.
3) In the update to Boost Config, I have created these macros:
a) BOOST_BORLANDC = __BORLANDC__ with __clang__ not defined b) BOOST_CODEGEARC = __CODEGEARC__ with __clang__ not defined c) BOOST_EMBTC = Embarcadero C++ compilers with __clang__ defined
Are these macros not documented in Boost.Config?
They are not documented in the Boost.Config documentation. But neither are any other BOOST_ compiler specific macros.
They are documented here: https://github.com/boostorg/config/blob/205b5451822f8e0ad24d62a0c47575178dce... See BOOST_MSVC, BOOST_GCC, BOOST_CLANG, etc.
BOOST_BORLANDC = __BORLANDC__ && !__clang__ BOOST_CODEGEARC = __CODEGARC__ && !__clang__ BOOST_EMBTC = __CODEGEARC__ && __clang__
I did not want to have to type the equivalent of the long form whenever Boost config.hpp was included in some library's code, so I created the macros in borland.hpp and embarcadero.hpp in Boost.Config. In cases in a library's code where Boost config.hpp is not being included in some TU (rare) I create the equivalent of the long form as my fix.
The idea of my PRs to incorporate Embracadero's clang-based compilers into Boost was to change all the old references to __BORLANDC__ and __CODEGEARC__ to BOOST_BORLANDC and BOOST_CODEGEARC respectively so that the Embarcadero clang based compilers are not affected by them. There are still bugs in the Embarcadero clang based compilers, but much, much less than in the old bcc32.
Having the dedicated macros to detect particular compilers is fine. But we need to document what those macros mean (i.e. which compilers they represent).
On 5/1/2020 11:59 AM, Andrey Semashev via Boost wrote:
On 2020-05-01 18:50, Edward Diener via Boost wrote:
On 5/1/2020 10:37 AM, Andrey Semashev via Boost wrote:
On 2020-03-30 19:45, Edward Diener via Boost wrote:
2) Updating Boost Config to support the clang-based compilers. I have done this and the PR has been merged to 'develop' on Boost Config.
3) In the update to Boost Config, I have created these macros:
a) BOOST_BORLANDC = __BORLANDC__ with __clang__ not defined b) BOOST_CODEGEARC = __CODEGEARC__ with __clang__ not defined c) BOOST_EMBTC = Embarcadero C++ compilers with __clang__ defined
Are these macros not documented in Boost.Config?
They are not documented in the Boost.Config documentation. But neither are any other BOOST_ compiler specific macros.
They are documented here:
https://github.com/boostorg/config/blob/205b5451822f8e0ad24d62a0c47575178dce...
See BOOST_MSVC, BOOST_GCC, BOOST_CLANG, etc.
BOOST_BORLANDC = __BORLANDC__ && !__clang__ BOOST_CODEGEARC = __CODEGARC__ && !__clang__ BOOST_EMBTC = __CODEGEARC__ && __clang__
I did not want to have to type the equivalent of the long form whenever Boost config.hpp was included in some library's code, so I created the macros in borland.hpp and embarcadero.hpp in Boost.Config. In cases in a library's code where Boost config.hpp is not being included in some TU (rare) I create the equivalent of the long form as my fix.
The idea of my PRs to incorporate Embracadero's clang-based compilers into Boost was to change all the old references to __BORLANDC__ and __CODEGEARC__ to BOOST_BORLANDC and BOOST_CODEGEARC respectively so that the Embarcadero clang based compilers are not affected by them. There are still bugs in the Embarcadero clang based compilers, but much, much less than in the old bcc32.
Having the dedicated macros to detect particular compilers is fine. But we need to document what those macros mean (i.e. which compilers they represent).
I have PR ed a fix to document the macros in Boost.Config.
participants (2)
-
Andrey Semashev
-
Edward Diener