![]() ![]() ![]() Such a build can also detect implementation-defined behavior, undefined behavior, and (in rare cases) compiler bugs. To ensure that a project keeps building with other compilers, it is useful to regularly build it with a new compiler. If you depend on a particular compiler or nonstandard features, that dependency should be documented in the project's build documentation and ideally enforced by the build system. Generally, all of those compiler-specific features are to be avoided, unless the project explicitly supports only compilers that offer nonstandard features. These assumptions can appear in many places within a project, from command-line options to supported features to compiler extensions. When you try to compile a project with a compiler not usually used by the project, one of the most frequent problems is the project's assumptions about the compiler in use. We'll focus on a system where GCC is currently the default compiler and consider Clang as the main alternative. ![]() In this article, we'll take a look at why one might use more than one compiler. Red Hat Enterprise Linux 8 offers the LLVM toolset, which contains Clang. However, there are several reasons why you might also build your project with Clang. On Red Hat Enterprise Linux 8, the system compiler for C and C++ is GNU Compiler Collection (GCC) 8, and newer versions are available through the GCC toolset. For a multitude of reasons, developers usually compile the project they are working on with only one compiler. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |