C Programming Language Compiler (Programming Software)
In the previous section "C programming language compiling and linking", we have explained the concept of C programming language compiler. Since C programming language has a long history, and there was no standard in the early days, the entire computer industry is also in the era of pioneering, so it is necessary to Many C programming language compilers have emerged, each with its own characteristics and suitable for different platforms. This section will give you some popular science.
We introduce compilers for the C programming language in two parts, desktop operating systems and embedded operating systems.
desktop operating system
For the current mainstream desktop operating systems, the three major compilers Visual C++, GCC and LLVM Clang can be used.
Visual C++ (MSVC for short) was developed by Microsoft and can only be used on Windows operating systems; GCC and LLVM Clang are mainly used on Unix/Linux operating systems besides Windows operating systems.
For example, many versions of Linux now use GCC as the C programming language compiler by default, while systems such as FreeBSD and macOS use the LLVM Clang compiler by default. Since the current LLVM project is mainly developed under Apple's main push, in macOS, the Clang compiler is also known as the Apple LLVM compiler.
MSVC compiler is mainly used for application development under Windows operating system platform, it is not open source. Users can use the Visual Studio Community edition for free, but if you want to use the Visual Studio Community tools for commercial use, you have to read Microsoft's license and instructions carefully.
However, applications built with GCC and Clang compilers generally have no restrictions, and programmers can freely distribute and commercialize applications.
The MSVC compiler has very limited support for the C99 standard, and until the release of Visual Studio Community 2019, there was partial support for the C11 and C17 standards. Fortunately, Visual Studio Community 2017 added support for the Clang compiler, officially called Clang with Microsoft CodeGen, and the current version is based on Clang 3.8.
From its birth to the present, C programming language has been updated and iterated with multiple versions, such as C99, C11, C17, etc.
That is, the Clang compiler front-end applied to the Visual Studio IDE supports all the syntax features of the Clang compiler, while the back-end generates code that behaves like MSVC, including integer types like long in 64-bit compilation mode. It is still 4 bytes, so you need to pay attention when you use it.
For the convenience of description, the Clang compiler in the Visual Studio integrated development environment is referred to as the VS-Clang compiler for short.
Embedded Systems
In the embedded system, the available C programming language compiler is very rich, such as:
-
Keil C51 compiler for Keil's 51 series microcontrollers;
-
The development kit carried by the current popular Arduino board can use the AVR GCC compiler for AVR microcontrollers;
-
ARM's own ADS (ARM Development Suite), RVDS (RealView Development Suite) and the latest DS-5 Studio;
-
CCS (Code Composer Studio) of DSP designer TI (Texas Instruments);
-
Visual DSP++ compiler from DSP designer ADI (Analog Devices, Inc.), etc.
Usually, there is no free version of the compilation tool chain used for embedded system development, and it generally needs to be purchased through domestic agents. Therefore, this is a high threshold for individual developers or embedded system enthusiasts.
However, the Arduino development kit is free to download and use, and it is also very simple to use it to connect and debug the development board. The C compiler used by Arduino is based on GCC.
There are also mini computers like the Raspberry Pi that can directly use the GCC and Clang compilers. In addition, there are Jetson TK series development boards like nVidia that can directly use GCC and Clang compilers. Both the Raspberry Pi and the Jetson TK have the Linux operating system installed by default.
In the embedded field, low-end microcontrollers, such as 8-bit MCUs, may only support the C90 standard, and some even do not support many features of the C90 standard. Because on the one hand, they have small memory and small ROM capacity; on the other hand, their processor functions are very limited, and some cannot even support function pointers, because the processor itself does not contain instructions for indirect procedure calls through registers.
And like 32-bit processor or DSP, generally can support at least C99 standard, their own performance is also very powerful. And RVDS compilers like ARM can even use GNU syntax extensions.